本文翻译自:Node.js/Windows error: ENOENT, stat 'C:\Users\RT\AppData\Roaming\npm'
I have Windows 7 32-bit. 我有Windows 7 32位。 I installed the latest Node.js 32 bit. 我安装了最新的Node.js 32位。 When I try to run the command npm install jquery
, I receive the error: 当我尝试运行命令npm install jquery
,我收到错误:
Error: ENOENT, stat 'C:\\Users\\RT\\AppData\\Roaming\\npm 错误:ENOENT,stat'C:\\ Users \\ RT \\ AppData \\ Roaming \\ npm
How does one resolve it? 如何解决它?
#1楼
参考:https://stackoom.com/question/1hHuG/Node-js-Windows错误-ENOENT-stat-C-Users-RT-AppData-Roaming-npm
#2楼
Manually creating a folder named 'npm' in the displayed path fixed the problem. 在显示的路径中手动创建名为“npm”的文件夹可解决问题。
More information can be found on Troubleshooting page 可在“ 故障排除”页面上找到更多信息
#3楼
I ran into the same problem while installing a package via npm. 我通过npm安装包时遇到了同样的问题。
After creating the npm
folder manually in C:\\Users\\UserName\\AppData\\Roaming\\
that particular error was gone, but it gave similar multiple errors as it tried to create additional directories in the npm
folder and failed. 在C:\\Users\\UserName\\AppData\\Roaming\\
中手动创建npm
文件夹后,特定错误消失,但它尝试在npm
文件夹中创建其他目录时出现类似的多个错误并失败。 The issue was resolved after running the command prompt as an administrator . 以管理员身份运行命令提示符后,问题得以解决。
#4楼
Install a stable version instead of the latest one, I have downgrade my version to node-v0.10.29-x86.msi
from 'node-v0.10.33-x86.msi'
and it is working well for me! 安装稳定版本而不是最新版本,我已将我的版本从'node-v0.10.33-x86.msi'
降级到node-v0.10.29-x86.msi
,它对我来说效果很好!
http://blog.nodejs.org/2014/06/16/node-v0-10-29-stable/ http://blog.nodejs.org/2014/06/16/node-v0-10-29-stable/
#5楼
This can also be fixed by installing a node package manually. 这也可以通过手动安装节点包来解决。
npm install npm -g
The process of doing that will setup all the required directories. 这样做的过程将设置所有必需的目录。
#6楼
您可以转到“ 开始”菜单并搜索Node.js图标并打开shell,然后安装任何内容
install <packagename> -g