I have Windows 7 32-bit. I installed the latest Node.js 32 bit. When I try to run the command npm install jquery
, I receive the error:
我有32位的Windows 7。我安装了最新的节点。js 32位。当我尝试运行命令npm安装jquery时,我收到了错误:
Error: ENOENT, stat 'C:\Users\RT\AppData\Roaming\npm
错误:ENOENT,统计用户C:\ \ RT \ AppData \ \ npm徘徊
How does one resolve it?
如何解决这个问题?
7 个解决方案
#1
1791
Manually creating a folder named 'npm' in the displayed path fixed the problem.
在显示的路径中手动创建一个名为“npm”的文件夹,解决了这个问题。
More information can be found on Troubleshooting page
更多信息可以在故障诊断页面找到。
#2
104
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. The issue was resolved after running the command prompt as an administrator.
在创建了npm文件夹手动C:\Users\UserName\AppData\Roaming\这个错误消失了,但却给了相似的多个错误,因为它试图在npm文件夹中创建额外的目录,但都以失败告终。这个问题在作为管理员运行命令提示符后得到了解决。
#3
87
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.
这样做的过程将设置所有必需的目录。
#4
8
I recommend setting an alternative location for your npm modules.
我建议为您的npm模块设置一个替代位置。
npm config set prefix C:\Dev\npm-repository\npm --global
npm config set cache C:\Dev\npm-repository\npm-cache --global
Of course you can set the location to wherever best suits.
当然,你可以把地点设为最适合的地方。
This has worked well for me and gets around any permissions issues that you may encounter.
这对我来说很有效,并且解决了您可能遇到的任何权限问题。
#5
2
You can go to the Start Menu and search the Node.js icon and open the shell and then install anything with
您可以进入开始菜单并搜索该节点。js图标,打开shell,然后安装任何东西
install <packagename> -g
#6
0
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.29-x86。从“node-v0.10.33-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/
#7
0
I needed a package from github that was written in typscript. I did a git pull of the most recent version from the master branch into the root of my main project. I then went into the directory and did an npm install so that the gulp commands would work that generates ES5 modules. Anyway, to make the long story short, my build process was trying to build files from this new folder so I had to move it out of my root. This was causing these same errors.
我需要一个github上用排版的软件包。我将最新版本的git从主分支拉到主项目的根。然后我进入目录并进行了npm安装,以便gulp命令能够工作,生成ES5模块。总之,长话短说,我的构建过程试图从这个新文件夹构建文件,所以我必须将它从根目录中移除。这导致了同样的错误。
#1
1791
Manually creating a folder named 'npm' in the displayed path fixed the problem.
在显示的路径中手动创建一个名为“npm”的文件夹,解决了这个问题。
More information can be found on Troubleshooting page
更多信息可以在故障诊断页面找到。
#2
104
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. The issue was resolved after running the command prompt as an administrator.
在创建了npm文件夹手动C:\Users\UserName\AppData\Roaming\这个错误消失了,但却给了相似的多个错误,因为它试图在npm文件夹中创建额外的目录,但都以失败告终。这个问题在作为管理员运行命令提示符后得到了解决。
#3
87
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.
这样做的过程将设置所有必需的目录。
#4
8
I recommend setting an alternative location for your npm modules.
我建议为您的npm模块设置一个替代位置。
npm config set prefix C:\Dev\npm-repository\npm --global
npm config set cache C:\Dev\npm-repository\npm-cache --global
Of course you can set the location to wherever best suits.
当然,你可以把地点设为最适合的地方。
This has worked well for me and gets around any permissions issues that you may encounter.
这对我来说很有效,并且解决了您可能遇到的任何权限问题。
#5
2
You can go to the Start Menu and search the Node.js icon and open the shell and then install anything with
您可以进入开始菜单并搜索该节点。js图标,打开shell,然后安装任何东西
install <packagename> -g
#6
0
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.29-x86。从“node-v0.10.33-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/
#7
0
I needed a package from github that was written in typscript. I did a git pull of the most recent version from the master branch into the root of my main project. I then went into the directory and did an npm install so that the gulp commands would work that generates ES5 modules. Anyway, to make the long story short, my build process was trying to build files from this new folder so I had to move it out of my root. This was causing these same errors.
我需要一个github上用排版的软件包。我将最新版本的git从主分支拉到主项目的根。然后我进入目录并进行了npm安装,以便gulp命令能够工作,生成ES5模块。总之,长话短说,我的构建过程试图从这个新文件夹构建文件,所以我必须将它从根目录中移除。这导致了同样的错误。