簡體   English   中英

create-react-app 和 npm 啟動時出現錯誤“找不到模塊”

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

我正在嘗試運行 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

我有同樣的錯誤,我改變了我的路徑並刪除了所有#形式。

應該是這樣的#React/myProject/project#1 => React/myProject/project1

讀取目錄時出現問題,因為您的文件路徑中有 # 字符。 不要在目錄路徑中使用 # 和類似符號。 干得好。

謝謝大家的幫助,錯誤解決了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM