简体   繁体   English

Npm错误:无法加载插件导入:找不到模块'../docsUrl'

[英]Npm Error: Failed to load plugin import: Cannot find module '../docsUrl'

Getting following error on npm start npm start出现以下错误

Failed to compile.

Error in ./src/index.js
Module build failed: Error: Failed to load plugin import: Cannot find module '../docsUrl'
Referenced from: game/package.json
 @ multi main

Already tried to reinstall nvm, node, npm. 已经尝试重新安装nvm,node,npm。 Didn't solve my problem. 没有解决我的问题。 Any idea how to solve this error? 任何想法如何解决此错误? I can't find any npm package on their website which is called docsUrl. 我在他们的网站上找不到名为docsUrl的任何npm软件包。

This happens to me when I accidentally update eslint-plugin-import from version 2.8.0 (which is default for create-react-app) to 2.9.0 . 当我不小心将eslint-plugin-import从2.8.0版本(create-react-app的默认设置)更新为2.9.0时,这会发生在我身上。

Solution

  1. Remove package eslint-plugin-import from node_modules eslint-plugin-import删除软件包eslint-plugin-import
  2. Remove package-lock.json file 删除package-lock.json文件
  3. Make sure you have "eslint-plugin-import": "2.8.0" in depedency section in your package.json 确保您的package.json的depedency部分具有"eslint-plugin-import": "2.8.0"
  4. Run npm install 运行npm install
  5. Everything should work now 现在一切正常

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM