簡體   English   中英

運行 npm 啟動和使用 npx create-react-app 創建 React 應用程序時出錯

[英]Error running npm start and creating React application using npx create-react-app

我在我的系統上安裝了節點和 npm 但是當我嘗試使用 npx 創建 react-app 甚至運行 npm 啟動節點應用程序時,我看到下面的錯誤。 在 C:\Users\DELL\Desktop\ReactApp\my-app 中創建一個新的 React 應用程序。

The term '/d' is not recognized as the name of a cmdlet, function, script file,
 or operable program. Check the spelling of the name, or if a path was included
, verify that the path is correct and try again.
At line:1 char:3
+ /d <<<<  /s /c npm --version
    + CategoryInfo          : ObjectNotFound: (/d:String) [], CommandNotFoundE
   xception
    + FullyQualifiedErrorId : CommandNotFoundException



DELL@DELL-PC MINGW64 ~/Desktop/ReactApp
$ npx create-react-app my-app

Creating a new React app in C:\Users\DELL\Desktop\ReactApp\my-app.

The term '/d' is not recognized as the name of a cmdlet, function, script file,
 or operable program. Check the spelling of the name, or if a path was included
, verify that the path is correct and try again.
At line:1 char:3
+ /d <<<<  /s /c npm --version
    + CategoryInfo          : ObjectNotFound: (/d:String) [], CommandNotFoundE
   xception
    + FullyQualifiedErrorId : CommandNotFoundException.

我面臨同樣的情況。 解決方案是重新啟動新下載的 Visual Studio 代碼,它將獲得 NPM 和 Node.js 的正確路徑。

暫無
暫無

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

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