npm VS代码中的npx-create-react-app my-app命令错误

mm5n2pyu  于 2022-12-23  发布在  React
关注(0)|答案(2)|浏览(219)
npx : The term 'npx' 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:1
+ npx create-react-app my-app
+ ~~~
    + CategoryInfo          : ObjectNotFound: (npx:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
goucqfw6

goucqfw61#

您应该全局安装npx,请尝试以下操作:

npm i -g npx

在Mac/Linux上使用sudo:

sudo npm i -g npx
wgx48brx

wgx48brx2#

你安装了Node.js吗?
https://nodejs.org/en/download/
如果是,则可能是“PATH环境变量”问题
Fixing npm path in Windows 8 and 10

相关问题