【问题标题】:React js code: 'MODULE_NOT_FOUND', not able to run reactjs?React js代码:'MODULE_NOT_FOUND',无法运行reactjs?
【发布时间】:2022-01-04 06:24:59
【问题描述】:

我在运行npm i 后面临这个问题实际上这个反应应用程序由某人共享,所以现在我正试图在我的电脑上运行它。首先我运行npm i 来安装npm,但这会给出如下错误:-

我只想运行这段代码,我该怎么做?有什么问题?

error

感谢您的努力!

【问题讨论】:

标签: node.js reactjs webpack npm-install npm-start


【解决方案1】:

清除所有内容并重试:

npm cache clear --force
rm -rf node_modules
npm install

【讨论】:

  • 运行rm -rf node_modules时出现错误
  • npm WARN using --force 禁用推荐的保护。 PS E:\Project\test\ClientApp> rm -rf node_modules Remove-Item:找不到与参数名称“rf”匹配的参数。在 line:1 char:4 + rm -rf node_modules + ~~~ + CategoryInfo : InvalidArgument: (:) [Remove-Item], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
  • 试试rm -r -fo node_modules 而不是第2行
【解决方案2】:

运行以下命令:

npm install --save tapable

然后运行你的项目。

【讨论】:

  • 完成了这个但仍然得到同样的错误......
  • 你能分享你的 package.json 依赖 json 吗?
  • "devDependencies": { "eslint": "^6.6.0", "eslint-config-airbnb": "^18.0.1", "eslint-config-prettier": "^6.5 .0”、“eslint-plugin-import”:“^2.18.2”、“eslint-plugin-jsx-a11y”:“^6.2.3”、“eslint-plugin-prettier”:“^3.1.1” ,“eslint-plugin-react”:“^7.16.0”,“eslint-plugin-react-hooks”:“^2.2.0”,“node-sass”:“^4.14.1”,“redux-devtools -extension": "^2.13.8", "redux-logger": "^3.0.6" }
  • 不是devDependencies先生,需要看dependencies
  • 我在 sn-p 中添加了依赖项,请立即查看
猜你喜欢
  • 2021-08-29
  • 1970-01-01
  • 2022-06-24
  • 1970-01-01
  • 1970-01-01
  • 2021-03-15
  • 1970-01-01
  • 1970-01-01
  • 2020-12-01
相关资源
最近更新 更多