【问题标题】:npx-create-react-app my-app command ERROR in Vs CodeVs 代码中的 npx-create-react-app my-app 命令错误
【发布时间】:2026-02-17 16:30:01
【问题描述】:
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

【问题讨论】:

    标签: javascript node.js reactjs npm npx


    【解决方案1】:

    你安装了 Node.Js 了吗?

    https://nodejs.org/en/download/

    如果是这样,可能是“PATH 环境变量”问题

    Fixing npm path in Windows 8 and 10

    【讨论】:

    • 是的,我已经安装了 node.js,并且没有任何 Path 环境变量问题。我尝试为 windows 安装 node.js 32bit,现在它工作正常。
    【解决方案2】:

    你应该全局安装 npx,试试这个:

    npm i -g npx
    

    在 mac/linux 上使用 sudo:

    sudo npm i -g npx
    

    【讨论】:

      最近更新 更多