1, 如果你也遇到下面的问题,你可以 按照命令行提示的那样,下面这四步完成的一般就可以了,但是不排除你在运行的时候忘记下载某些依赖。
- 【1】 删除
package-lock.json
(不是package.json
) 你可以选择 yarn.lock
或者不要,我是没有做这步的
- 【2】删除
node_modules
在你的项目文件夹里面的 node_modules
- 【3】移除你自己下载的
eslint
, 在 package.json
里面的dependencies 或者 devDependencies
- 【4】然后再重新
npm install
使用npm
存在丢包现象,所以项目中使用 yarn
可能会好一点
1. Delete package-lock.json (not package.json!) and/or yarn.lock in your proje ct folder.
2. Delete node_modules in your project folder.
4. Remove "eslint" from dependencies and/or devDependencies in the package.json file in your project folder.
6. Run npm install or yarn, depending on the package manager you use.
如果上面四步没法完成的话
npm install yarn
之后使用 ya