gpt4 book ai didi

windows - npm 安装 socket.io 失败

转载 作者:可可西里 更新时间:2023-11-01 11:17:57 26 4
gpt4 key购买 nike

我安装了 nodejs v0.12.2,以及 Visual C++ express 2010 和 Visual Studio 2010 Service Pack 1。当我运行 npm install -g socket.io 时,出现数千行错误。

类似下面的内容,任何人都可以帮助研究和修复此错误?

D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-client\node_modules\eng
ine.io-client\node_modules\ws>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodej
s\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (r
ebuild)
Building the projects in this solution one at a time. To enable parallel build, please add the "/m"
switch.
bufferutil.cc
D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-client\node_modules\en
gine.io-client\node_modules\ws\node_modules\nan\nan.h(213): error C2039: 'ThrowException' : is not
a member of 'v8' [D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-clie
nt\node_modules\engine.io-client\node_modules\ws\build\bufferutil.vcxproj]
D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-client\node_modules\en
gine.io-client\node_modules\ws\node_modules\nan\nan.h(213): error C2039: 'New' : is not a member of
'v8::String' [D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-client\
node_modules\engine.io-client\node_modules\ws\build\bufferutil.vcxproj]
C:\Users\czhu\.node-gyp\0.12.2\deps\v8\include\v8.h(1599) : see declaration of 'v8::Strin
g'
D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-client\node_modules\en
gine.io-client\node_modules\ws\node_modules\nan\nan.h(213): error C3861: 'ThrowException': identifi
er not found [D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-client\n
ode_modules\engine.io-client\node_modules\ws\build\bufferutil.vcxproj]
D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-client\node_modules\en
gine.io-client\node_modules\ws\node_modules\nan\nan.h(213): error C3861: 'New': identifier not foun
d [D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-client\node_modules
\engine.io-client\node_modules\ws\build\bufferutil.vcxproj]
D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-client\node_modules\en
gine.io-client\node_modules\ws\node_modules\nan\nan.h(218): error C2039: 'ThrowException' : is not
a member of 'v8' [D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-clie
nt\node_modules\engine.io-client\node_modules\ws\build\bufferutil.vcxproj]
D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-client\node_modules\en
gine.io-client\node_modules\ws\node_modules\nan\nan.h(218): error C3861: 'ThrowException': identifi
er not found [D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-client\n
ode_modules\engine.io-client\node_modules\ws\build\bufferutil.vcxproj]
D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-client\node_modules\en
gine.io-client\node_modules\ws\node_modules\nan\nan.h(222): error C2039: 'New' : is not a member of
'v8::String' [D:\GitProjects\almwplus\client\node_modules\socket.io\node_modules\socket.io-client\
node_modules\engine.io-client\node_modules\ws\build\bufferutil.vcxproj]

最佳答案

我遇到了同样的问题,在我看来这像是 engine.io-client 安装的 ws 版本的问题。移动到较新版本的 ws 为我解决了这个问题。一种方法是从 github 安装最新(未发布)版本的 socket.io:

npm install -g automattic/socket.io

关于windows - npm 安装 socket.io 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29914721/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com