1- 单词写错
2.路径错误,拼接路径后面多了一个点
- 路径拼接错误 `// 1.引入fs模块和path模块 const fs = require('fs') const path = require('path')
const newPath = path.join(__dirname, 'db', 'data.json') // console.log(newPath) //2. 读取文件 const newFile = fs.readFileSync(newPath, 'utf8') // 转成数组 const arr = JSON.parse(newFile) //添加一个对象 arr.push({ name: '小张' }) const newJson = JSON.stringify(arr) // // console.log(newJson) fs.writeFileSync(newPath, newJson) `
4.下载包错误
5.服务器响应参数错误
6.端口已被占用,报错
7.jsonp返回的值如果不是字符串报错。
8.传参类型错误
9.对象转字符串输出结果是[Object,Object]
10.计算属性sum的值被修改了,但是它并没有setter,就报错了
11.在子组件直接修改父组件的数据会报警告。