为什么在尝试安装socket.io时遇到错误nmp
为什么在尝试安装socket.io时出现此错误。我正在使用最新版本的NodeJS并设置路径变量。 我在cmd中以管理员权限使用Windows 7。为什么在尝试安装socket.io时遇到错误nmp
> [email protected] install C:\Users\Dusan\node_modules\socket.io\node_modules\socket.io
-client\node_modules\ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
CreateProcessW: The system cannot find the file specified.
npm ERR! error rolling back Error: ENOTEMPTY, rmdir 'C:\Users\Dusan\node_modules
\socket.io\node_modules\socket.io-client\node_modules\active-x-obfuscator\node_m
odules\zeparser'
npm ERR! error rolling back [email protected] { [Error: ENOTEMPTY, rmdir
'C:\Users\Dusan\node_modules\socket.io\node_modules\socket.io-client\node_module
s\active-x-obfuscator\node_modules\zeparser']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: 'C:\\Users\\Dusan\\node_modules\\socket.io\\
node_modules\\socket.io-client\\node_modules\\active-x-obfuscator\\node_modules\
\zeparser' }
npm ERR! error rolling back Error: EPERM, rmdir 'C:\Users\Dusan\node_modules\soc
ket.io\node_modules\socket.io-client\node_modules\active-x-obfuscator\node_modul
es\zeparser\benchmark.html'
npm ERR! error rolling back [email protected] { [Error: EPERM, rmdir 'C:\Users\D
usan\node_modules\socket.io\node_modules\socket.io-client\node_modules\active-x-
obfuscator\node_modules\zeparser\benchmark.html']
npm ERR! error rolling back errno: 50,
npm ERR! error rolling back code: 'EPERM',
npm ERR! error rolling back path: 'C:\\Users\\Dusan\\node_modules\\socket.io\\
node_modules\\socket.io-client\\node_modules\\active-x-obfuscator\\node_modules\
\zeparser\\benchmark.html' }
npm ERR! [email protected] install: `(node-gyp rebuild 2> builderror.log) || (exit 0)`
npm ERR! `cmd "/c" "(node-gyp rebuild 2> builderror.log) || (exit 0)"` failed wi
th 127
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the ws package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! (node-gyp rebuild 2> builderror.log) || (exit 0)
npm ERR! You can get their info via:
npm ERR! npm owner ls ws
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket.io"
npm ERR! cwd C:\Users\Dusan
npm ERR! node -v v0.8.21
npm ERR! npm -v 1.2.11
npm ERR! code ELIFECYCLE
npm ERR! Error: ENOENT, lstat 'C:\Users\Dusan\node_modules\socket.io\node_module
s\socket.io-client\node_modules\active-x-obfuscator\node_modules\zeparser\benchm
ark.html'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected].com>
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket.io"
npm ERR! cwd C:\Users\Dusan
npm ERR! node -v v0.8.21
npm ERR! npm -v 1.2.11
npm ERR! path C:\Users\Dusan\node_modules\socket.io\node_modules\socket.io-clien
t\node_modules\active-x-obfuscator\node_modules\zeparser\benchmark.html
npm ERR! fstream_path C:\Users\Dusan\node_modules\socket.io\node_modules\socket.
io-client\node_modules\active-x-obfuscator\node_modules\zeparser\benchmark.html
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Program Files (x86)\nodejs\node_modules\npm\node_modul
es\fstream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:297:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\Dusan\npm-debug.log
npm ERR! not ok code 0
我不知道发布此问题的其他方式。请编辑这个。
我不需要安装node-gyp,但它看起来像你一样。首先运行这个,
$ npm install -g node-gyp
然后再试一次。如果失败,请为PATH传播重新启动计算机。
这并没有帮助我。 – carobnodrvo 2013-03-04 18:38:23
我在Mac上有类似的问题。 什么解决了我的问题是安装稍微旧版本的Socket.io。
我所做的:
npm install [email protected]"~0.8.1"
这将安装0.8.0的最新版本0.8.9,而不是0.9.0或以上。
Socket.io then installed perfectly.
我也装
sudo npm install -g node-gyp
,但它本身并没有解决问题。
给所有在共享文件夹的虚拟机上与此斗争的人。没有任何这些建议,我没有运气,但一段时间后,我试图安装到另一个不是共享文件夹的位置,一切都完美无缺。或者您可以尝试从托管虚拟机的主计算机将其安装到该文件夹。希望这会帮助某人。
确认。我在共享文件夹中遇到了同样的问题,但'npm install socket.io'没有版本规范(当前为0.9),在我的主目录中工作正常。 我发现http://askubuntu.com/a/269735/91786也很有帮助。它说使用'--no-bin-links'选项是合理的,因为Windows(我的主机系统)不支持符号链接。 – N13 2014-02-19 17:09:09
要使用最新版本的socket.io的...首先确保您拥有所有必需的软件运行node-gyp
:
您可以配置使用的Visual Studio版本通过gyp
通过一个环境变量,所以你可以避免必须设置--msvs_version=2012
属性。
例子:
- 设置
GYP_MSVS_VERSION=2012
为Visual Studio 2012 - 设置
GYP_MSVS_VERSION=2013e
(在 'E' 代表 'Express版')
有关完整列表,请参阅 - https://github.com/joyent/node/blob/v0.10.29/tools/gyp/pylib/gyp/MSVSVersion.py#L209-294
对于NodeJS的Windows用户来说,这仍然很痛苦,因为它假定你有一个Python和Visu的副本al Studio已安装,许多最终用户将永远不会拥有此功能。因此,我正在向Joyent游说,鼓励他们将网络套接字包含为CORE节点的一部分,并且还可以将GNU gcc编译器作为NodeJS安装的一部分发布,以便我们可以永久解决此问题。
随意在添加您的投票:
谢谢你,这是我一直在寻找。 – carobnodrvo 2013-03-04 18:38:44
我希望我可以给你更多的积分,你的回答在两个月前救了我,在这里我今天再次与同一问题... – Narretz 2013-04-26 14:52:20