"npx create-react-app my app"命令不起作用


**Purva@DESKTOP-SS7ERSC /cygdrive/c**
$ npx create-react-app my-app
npm ERR! code ENOENT
npm ERR! syscall spawn C:Program Files (x86)mingw-w64i686-8.1.0-posix-dwarf-r
t_v6-rev0mingw32bin
npm ERR! path C:
npm ERR! errno -4058
npm ERR! enoent spawn C:Program Files (x86)mingw-w64i686-8.1.0-posix-dwarf-rt
_v6-rev0mingw32bin ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR!     C:UsersPurvaAppDataLocalnpm-cache_logs2023-04-10T08_29_03_15
4Z-debug-0.log

我已经尝试卸载nodejs,然后重新安装它。但同样的错误一次又一次地出现。我已经检查了环境变量,在其中,用户变量具有路径(仅与节点相关):

C:UsersPurvaAppDataRoamingnpm

和系统变量的路径为:

C:UsersPurvaAppDataRoamingnpmC:Program FilesnodejsC:Program Filesnodejsnode_modulesnpmbin

请帮我解决这个问题

尝试:

npx create-react-app@latest my-app

我不知道这是否有帮助,但是

npx create-react-app my-app

当我尝试创建我的第一个react应用程序时,不起作用,所以我使用yarn代替。命令

npm install --global yarn

安装yarn,然后你可以执行命令

yarn create react-app my-app

最新更新