You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用npx create-react-app创建React应用时遭遇ENOENT错误的解决求助

npx create-react-app创建React应用时遭遇ENOENT错误的解决求助

大家好,我最近在尝试创建React项目时碰到了一个头疼的问题,想请各位帮忙支支招。

我先确认了Node.js和npx的版本都是正常可用的:

PS C:\Users\layan> node -v
v21.7.3
PS C:\Users\layan> npx -v
10.5.0

但当我执行npx create-react-app projectone命令时,直接抛出了ENOENT错误,具体报错信息如下:

PS C:\Users\layan> npx create-react-app projectone
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:\Users\layan\AppData\Roaming\npm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\layan\AppData\Roaming\npm'
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: C:\Users\layan\AppData\Local\npm-cache\_logs\2024-04-20T15_02_05_667Z-debug-0.log

我已经反复重装了好几个不同版本的Node.js,但这个问题还是没解决,实在摸不着头绪了,有没有朋友遇到过类似的情况,能给我一些解决思路吗?

备注:内容来源于stack exchange,提问作者user24524612

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.17 10:14:39