提问者:小点点

使用npx create-react-app运行npm start和创建React应用程序时出错


我在我的系统上安装了node和npm,但是当我尝试使用npx创建react-app,甚至运行npm start for node application时,我看到了下面的错误。在C:UsersDellDesktopReactAppMy-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.

共1个答案

匿名用户

我也面临同样的情况。解决方案是重新启动新下载的Visual Studio代码,它将获得到NPM和节点的正确路径。