配置使用Eslint的时候 版本错误 "eslint": "5.6.0" a different version of eslint was detected higher up in the tr
2018-11-13 19:21
691 查看
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
之后使用
yarn代替上面的
npm执行上面四个步骤。
当然如果刚开始跟我一样大头虾,忘记下载安装各种依赖 例如
npm-install-all这些的要先记得下载安装
There might be a problem with the project dependency tree. It is likely not a bug in Create React App, but something you need to fix locall y. The react-scripts package provided by Create React App requires a dependency: "eslint": "5.6.0" Don't try to install it manually: your package manager does it automatically. However, a different version of eslint was detected higher up in the tree: E:\学习文件\React\ticket-app\node_modules\eslint (version: 5.9.0) Manually installing incompatible versions is known to cause hard-to-debug issues . If prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project. That will permanently disable this message but you might encounter other issues. To fix the dependency tree, try following the steps below in the exact order: 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. 3. Remove "eslint" from dependencies and/or devDependencies in the package.jso n file in your project folder. 4. Run npm install or yarn, depending on the package manager you use. In most cases, this should be enough to fix the problem. If this has not helped, there are a few other things you can try: 5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above st eps with it instead. This may help because npm has known issues with package hoisting which may get resolved in future versions. 6. Check if E:\学习文件\React\ticket-app\node_modules \eslint is outside your project directory. For example, you might have accidentally installed something in your home f older. 7. Try running npm ls eslint in your project folder. This will tell you which other package (apart from the expected react-scrip ts) installed eslint. If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your pro ject. That would permanently disable this preflight check in case you want to proceed anyway. P.S. We know this message is long but please read the steps above :-) We hope yo u find them helpful! npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! ticket-app@0.1.0 start-js: `react-scripts start` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the ticket-app@0.1.0 start-js script. npm ERR! This is probably not a problem with npm. There is likely additional log ging output above. npm ERR! A complete log of this run can be found in: npm ERR! F:\nodejs\node_cache\_logs\2018-11-13T09_20_40_840Z-debug.log ERROR: "start-js" exited with 1. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! ticket-app@0.1.0 start: `npm-run-all -p watch-css start-js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the ticket-app@0.1.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional log ging output above. npm ERR! A complete log of this run can be found in: npm ERR! F:\nodejs\node_cache\_logs\2018-11-13T09_20_42_191Z-debug.log
在遇到问题的时候,错误的提示是很重要的。终于解决了。。。
阅读更多相关文章推荐
- 单点登录(六)-----遇到问题-----cas server 源码部署导入gradle后有感叹号---错误信息A cycle was detected in the build path of pr
- webview使用遇到 It is possible that this object was over-released, or is in the process of deallocation错误的解决办法
- 单点登录(六)-----遇到问题-----cas server 源码部署导入gradle后有感叹号---错误信息A cycle was detected in the build path of pr
- “System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 错误
- 安装mysql-python错误python version2.7 required,which was not found in the registry.
- Eclipse Error:A cycle was detected in the build path of project
- A cycle was detected in the build path of project
- Java版本不同导致导入时的错误:java compiler level does not match the version of the installed java project
- 在使用eclipse 运行 maven install的时候,出现这个错误:Unable to locate the Javac Compiler in:…
- A cycle was detected in the build path of project
- "DBGridEh was compiled with a different version of GridsEh.TGridDrawState"错误解决
- A cycle was detected in the build path of project
- 编译出现错误: XXX was compiled with a different version of XXX
- 安装SP2后,提示"'Preserving/Deleting template record with size","The expected version of the product was not found on the “错误
- java包名前面有个红色的大叹号(A cycle was detected in the build path of project )
- poi导出excel报The maximum number of cell styles was exceeded. You can define up to 4000 styles in a .xl
- CFBundleVersion in the Info.plist file must contain a higher version than that of the previously uploaded version.
- A cycle was detected in the build path of project
- A cycle was detected in the build path of project
- 【ask】Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.