Node.js / Windows错误:ENOENT,stat'C:\ Users \ RT \ AppData \ Roaming \ npm'

本文翻译自: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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值