每次运行任何 npx 命令时,都会出现相同的错误。 除非我运行:
npx -v
然后它给我版本:9.2.0
这是错误:
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path E:\Development
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'E:\Development'
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:\Users\Tim\AppData\Local\npm-cache\_logs\2023-01-02T20_03_57_627Z-debug-0.log
我已经用 nvm 更新了 npm,但这并没有改变。
我想运行
npx create-react-app myApp
或 npx create-electron-app myApp
但每个命令都会给我同样的错误。
有人可以帮助我消除这个错误吗?
我认为您面临这个问题是因为您使用了大写字母。 试试这个
npx create-react-app my-app
我遇到了同样的问题,所以我只是做了这个“mkdir %USERPROFILE%\AppData\Roaming pm”,然后一切正常。似乎是某种安装错误,可能是因为我从计算机上的不同用户帐户安装了 NPM。