简体   繁体   English

创建反应应用程序错误-npm启动时出现“找不到模块”

[英]Create react app error - “Module not found” on npm start

I am trying to start React project with create-react-app. 我正在尝试使用create-react-app启动React项目。
Got an error on npm start : npm start上出错:

Failed to compile.

multi ./node_modules/react-scripts/config/polyfills.js ./node_modules/react-dev-utils/webpackHotDevClient.js ./src/index.js
Module not found: Can't resolve 'D:\' in 'D:\!!!DESKTOP\React-test\test-react'

How can I fix it? 我该如何解决?

Please follow these steps: 请按照以下步骤操作:

  1. Remove package-lock.json form the project's directory. 从项目目录中删除package-lock.json
  2. Then, run npm install . 然后,运行npm install
  3. And then, do npm start again. 然后,再次执行npm start
  4. If the issue persists do, rm -rf node_modules to remove the node_modules folder and start again from step 1. 如果问题仍然存在,请执行rm -rf node_modules除去node_modules文件夹,然后从步骤1重新开始。

Hope this helps. 希望这可以帮助。 :) :)

An exclamation mark is part of webpack loader syntax. 感叹号是webpack加载程序语法的一部分。 Remove exclamation sign from your directory path D:\\!!!DESKTOP\\React-test\\test-react More info - Webpack Loaders configuration 从目录路径D:\\!!!DESKTOP\\React-test\\test-react删除感叹号更多信息-Webpack Loaders配置

暂无
暂无

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

相关问题 'npm start' 上的 React.JS 应用 MODULE_NOT_FOUND 错误 - React.JS App MODULE_NOT_FOUND error on 'npm start' 使用 create-react-app 启动 npm 错误 - npm start error with create-react-app npm start throwing Sass Dart Error "Bad state: Can't access parent outside of a module" in Create React App - npm start throwing Sass Dart Error "Bad state: Can't access parent outside of a module" in Create React App Webpack:移动 webpack/react 文件的位置后,npm start “Module not found: Error: Can&#39;t resolve ...” - Webpack: npm start "Module not found: Error: Can't resolve ..." after moving location for webpack / react files npm 启动命令在反应应用程序中给出错误 - npm start command giving error in react app npm启动错误“找不到模块:错误:无法解析目录” - npm start error “Module not found: Error: Cannot resolve directory” 使用 npx create-react-app 创建应用后<myproject> ,并使用“npm start”启动应用程序我得到了下面提到的这个错误</myproject> - After creating app using npx create-react-app <myproject> , and start app by using "npm start" i got this error mentioned below npx create-react-app 在运行 npm 启动时出错 - npx create-react-app gives error when running npm start npm启动时模块构建失败并出现意外令牌错误-react / webpack - Module Build Failure with Unexpected token error on npm start - react/webpack npm 使用 create-react-app 时启动不运行 - npm start not running when using create-react-app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM