创建反应应用程序错误 - "Module not found" on npm start
Create react app error - "Module not found" on npm start
我正在尝试使用 create-react-app 启动 React 项目。
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'
我该如何解决?
请按照以下步骤操作:
- 从项目目录中删除
package-lock.json
。
- 然后,运行
npm install
.
- 然后,再做一次
npm start
。
- 如果问题仍然存在,
rm -rf node_modules
删除 node_modules
文件夹并从第 1 步重新开始。
希望这对您有所帮助。 :)
感叹号是 webpack 加载器语法的一部分。
从目录路径中删除感叹号 D:\!!!DESKTOP\React-test\test-react
更多信息 - Webpack Loaders configuration
我正在尝试使用 create-react-app 启动 React 项目。
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'
我该如何解决?
请按照以下步骤操作:
- 从项目目录中删除
package-lock.json
。 - 然后,运行
npm install
. - 然后,再做一次
npm start
。 - 如果问题仍然存在,
rm -rf node_modules
删除node_modules
文件夹并从第 1 步重新开始。
希望这对您有所帮助。 :)
感叹号是 webpack 加载器语法的一部分。
从目录路径中删除感叹号 D:\!!!DESKTOP\React-test\test-react
更多信息 - Webpack Loaders configuration