我想使用npx create-react-app my-app創建一個反應應用程式,它運行并創建一個包含 node_modules、package.json 和 yarn.lock 的檔案夾,沒有 src 和 public 檔案夾,它回傳的模板沒有提供,這很可能您使用的是過時的 create-react-app 版本,就像你們在螢屏截圖中看到的那樣。
節點 v16.15.1,npm v7.24.2
這是我使用的這個命令
這是最終的結果
uj5u.com熱心網友回復:
您是否嘗試過寫在最后一行的命令:npm uninstall -g create-react-app?然后再試一次npx create-react-app my-app
uj5u.com熱心網友回復:
我終于找到了解決方案。我只需要洗掉 node_modules 中的 create-react-app 檔案夾,因為卸載命令不起作用并運行此命令 npm install create-react-app@latest 然后問題就解決了。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/491609.html
上一篇:MERN堆疊專案中的React[create-react-app]正在提供依賴項
下一篇:如何在Angular上玩堡壘之夜
