每个命令的 npm 错误:EEXIST:文件已经存在,mkdir 'c:\users\user\appdata\Roaming\npm' [英] npm error on every command: EEXIST: file already exists, mkdir 'c:\users\user\appdata\Roaming\npm'
问题描述
我刚接触 node 和 npm,这令人沮丧.
I'm just new to node and npm and this is frustrating.
嗯,标题几乎都说了.在使用非提升提示的 Windows 10 x64 上,所有 npm 命令都显示:
Well it's almost all said in the title. On a Windows 10 x64 using a NON elevated prompt, all npm commands shows:
EEXIST: file already exists, mkdir 'c:\Users\Josep\AppData\Roaming\npm'
at Error (native)
甚至 npm -v 在版本号前显示两次.
Even npm -v shows it twice before the version number.
不会出现在提升的提示中.提升和用户提示中的版本号不同.
Not hapening in an elevated prompt. version numbers differ in an elevated and a user prompt.
双重检查 PATH 变量.在两个 cmd 窗口上相同.
Double checked PATH variable. Same on two cmd windows.
节点版本 6.10.0
Node version 6.10.0
NPM 版本:4.3.0 提升提示和 3.10.10 用户提示.
NPM Versions: 4.3.0 at elevated prompt and 3.10.10 at a user prompt.
推荐答案
尝试为非管理员帐户重新安装 node 和 npm.如果这不是一个选项,您可以使用便携式版本:
Try reinstalling node and npm for the non-admin account. If that's not an option, you can use the portable version:
从http://nodejs.org/dist/下载
提取存档.
打开 cmd
和 cd
到解压的文件夹.
运行 nodevars.bat
.
Download from http://nodejs.org/dist/
Extract the archive.
Open cmd
and cd
to the extracted folder.
Run nodevars.bat
.
它将设置 PATH 和其他内容,以便您现在可以使用此文件夹中的节点.
It will set PATH and other things so you can now use node from this folder.
这篇关于每个命令的 npm 错误:EEXIST:文件已经存在,mkdir 'c:\users\user\appdata\Roaming\npm'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!