'npm install -g'找不到'Roaming \ npm \ node_modules \'目录

我刚刚将nodejs下载并安装到新机器上,但是'npm install -g'和'npm install'命令均无效。它给出了ENOENT错误。我检查了普遍安装软件包的路径,即“ C:\ Users \ USER \ AppData \ Roaming \ npm \ node_modules”文件夹,错误提示找不到“ lib”或“ bin”文件夹,但找到了所有由命令缺少第一个字母。尝试全局安装打字稿时,显示以下我出现的npm错误。我似乎找不到解决方案,有人知道我该怎么办吗?预先感谢。

npm WARN tar ENOENT: no such file or directory,open 'C:\Users\USER\AppData\Roaming\npm\node_modules\.staging\typescript-21dd751b\bin\tsc'
npm WARN tar ENOENT: no such file or directory,open 'C:\Users\USER\AppData\Roaming\npm\node_modules\.staging\typescript-21dd751b\bin\tsserver'
npm WARN tar ENOENT: no such file or directory,open 'C:\Users\USER\AppData\Roaming\npm\node_modules\.staging\typescript-21dd751b\lib\cancellationToken.js'
npm WARN tar ENOENT: no such file or directory,open 'C:\Users\USER\AppData\Roaming\npm\node_modules\.staging\typescript-21dd751b\lib\cs\diagnosticMessages.generated.json'
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\USER\AppData\Roaming\npm-cache\_logs\2019-11-12T12_33_04_656Z-debug.log

See folders' screenshot

PINGPING456 回答:'npm install -g'找不到'Roaming \ npm \ node_modules \'目录

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3117289.html

大家都在问