简体   繁体   English

create-react-app 和 npm 启动时出现错误“找不到模块”

[英]Error "Module not found" while create-react-app and npm start

I am trying to run create-react-app and after entering npm start I am getting this error我正在尝试运行 create-react-app 并在输入 npm start 后出现此错误

Failed to compile.

Module not found: Error: Can't resolve 'C:\Users\sande\OneDrive\Desktop\project#1\client\my-app\node_modules\webpack-dev-server\client\index.js?protocol=ws%3A&hostname=0.0.0.0&port=3000&pathname=%2Fws&logging=none&reconnect=10' in 'C:\Users\sande\OneDrive\Desktop\project#1\client\my-app'
ERROR in Module not found: Error: Can't resolve 'C:\Users\sande\OneDrive\Desktop\project#1\client\my-app\node_modules\webpack-dev-server\client\index.js?protocol=ws%3A&hostname=0.0.0.0&port=3000&pathname=%2Fws&logging=none&reconnect=10' in 'C:\Users\sande\OneDrive\Desktop\project#1\client\my-app'

webpack compiled with 1 error

I had the same error, I change my path and remove all # form it.我有同样的错误,我改变了我的路径并删除了所有#形式。

It should be like this #React/myProject/project#1 => React/myProject/project1应该是这样的#React/myProject/project#1 => React/myProject/project1

There is a problem while reading the directory because there is a # character in your file path.读取目录时出现问题,因为您的文件路径中有 # 字符。 Do not use # and similar signs in your directory path.不要在目录路径中使用 # 和类似符号。 Good work.干得好。

谢谢大家的帮助,错误解决了。

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

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