无法使用带有zerorpc的npm install - msgpack包时出错

时间:2014-09-12 04:52:10

标签: node.js npm

当我尝试使用npm安装zerorpc库时,如下所示:

npm install zerorpc

我收到以下错误:

C:\Users\Jeff\AppData\Roaming\npm\node_modules\zerorpc\node_modules\msgpack>node "C:\Program Files (x86)\nodejs\node
_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  object.cpp
  objectc.c
  unpack.c
  vrefbuffer.c
  zone.c
  version.c
  libmsgpack.vcxproj -> C:\Users\Jeff\AppData\Roaming\npm\node_modules\zerorpc\node_modules\msgpack\build\Release\\
  libmsgpack.lib
  msgpack.cc
..\src\msgpack.cc(181): error C2466: cannot allocate an array of constant size 0 [C:\Users\Jeff\AppData\Roaming\npm
\node_modules\zerorpc\node_modules\msgpack\build\msgpackBinding.vcxproj]
..\src\msgpack.cc(181): error C2440: 'initializing' : cannot convert from 'int' to 'v8::Handle<v8::Value>' [C:\User
s\Jeff\AppData\Roaming\npm\node_modules\zerorpc\node_modules\msgpack\build\msgpackBinding.vcxproj]
          Constructor for class 'v8::Handle<v8::Value>' is declared 'explicit'
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\
build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.j
s" "rebuild"
gyp ERR! cwd C:\Users\Jeff\AppData\Roaming\npm\node_modules\zerorpc\node_modules\msgpack
gyp ERR! node -v v0.10.31
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok

在安装过程结束时,我收到以下错误:

npm ERR! msgpack@0.1.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the msgpack@0.1.8 install script.
npm ERR! This is most likely a problem with the msgpack package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls msgpack
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\
bin\\npm-cli.js" "install" "-g" "zerorpc"
npm ERR! cwd C:\node\pythontest
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\node\pythontest\npm-debug.log
npm ERR! not ok code 0

我正在Windows 7(x64)上运行一个干净的Node.js安装。

之前有没有人遇到过这个错误,如果有的话,我该怎么办呢?

谢谢!

修改

当我按如下方式单独安装msgpack时:

npm install msgpack

安装成功:

C:\node\pythontest\node_modules\msgpack>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..
\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  gcc_atomic.cpp
  object.cpp
  objectc.c
  unpack.c
  vrefbuffer.c
  zone.c
  version.c
  libmsgpack.vcxproj -> C:\node\pythontest\node_modules\msgpack\build\Release\\libmsgpack.lib
  msgpack.cc
C:\Users\Jeff\.node-gyp\0.10.31\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Pe
rsistent<v8::Object> v8::Persistent<v8::Object>::New(v8::Handle<v8::Object>)' [C:\node\pythontest\node_modules\msgp
ack\build\msgpackBinding.vcxproj]
C:\Users\Jeff\.node-gyp\0.10.31\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Pe
rsistent<v8::FunctionTemplate> v8::Persistent<v8::FunctionTemplate>::New(v8::Handle<v8::FunctionTemplate>)' [C:\nod
e\pythontest\node_modules\msgpack\build\msgpackBinding.vcxproj]
     Creating library C:\node\pythontest\node_modules\msgpack\build\Release\msgpackBinding.lib and object C:\node\p
  ythontest\node_modules\msgpack\build\Release\msgpackBinding.exp
  Generating code
c:\node\pythontest\node_modules\msgpack\src\msgpack.cc(360): warning C4715: 'unpack' : not all control paths return
 a value [C:\node\pythontest\node_modules\msgpack\build\msgpackBinding.vcxproj]
  Finished generating code
  msgpackBinding.vcxproj -> C:\node\pythontest\node_modules\msgpack\build\Release\\msgpackBinding.node
msgpack@0.2.4 node_modules\msgpack
└── nan@1.0.0

0 个答案:

没有答案