node-gyp rebuild总是返回错误

时间:2013-10-12 17:25:26

标签: node.js node-gyp node-memwatch

我正在尝试安装hiredis和memwatch。但是对node-gyp重建的调用返回错误如下。我认为需要重建节点源文件。我有源文件,但我不知道如何配置它。

G:\v0.2\node_modules\memwatch>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..
\node_modules\node-gyp\bin\node-gyp.js" rebuild
  heapdiff.cc
  memwatch.cc
  util.cc
  init.cc
g:\v0.2\node_modules\memwatch\src\heapdiff.hh(8): fatal error C1083: Cannot open include file: 'v8.
h': No such file or directory [G:\v0.2\node_modules\memwatch\build\memwatch.vcxproj]
..\src\init.cc(5): fatal error C1083: Cannot open include file: 'v8.h': No such file or directory [
G:\v0.2\node_modules\memwatch\build\memwatch.vcxproj]
g:\v0.2\node_modules\memwatch\src\memwatch.hh(8): fatal error C1083: Cannot open include file: 'nod
e.h': No such file or directory [G:\v0.2\node_modules\memwatch\build\memwatch.vcxproj]
C:\Program Files\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception
 handler used, but unwind semantics are not enabled. Specify /EHsc [G:\v0.2\node_modules\memwatch\b
uild\memwatch.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit c
ode: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\nod
e-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Windows_NT 6.1.7600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\
node-gyp.js" "rebuild"
gyp ERR! cwd G:\v0.2\node_modules\memwatch
gyp ERR! node -v v0.10.5
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! memwatch@0.2.2 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the memwatch@0.2.2 install script.
npm ERR! This is most likely a problem with the memwatch 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 memwatch
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\n
pm\\bin\\npm-cli.js" "install" "memwatch"
npm ERR! cwd G:\v0.2
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     G:\v0.2\npm-debug.log
npm ERR! not ok code 0

2 个答案:

答案 0 :(得分:2)

你在窗户上吗?你安装了Visual Studio吗?我不得不使用标志--msvs_version = 2012

答案 1 :(得分:0)

对于其他凡人,绊倒这个问题,试试:

npm -g install npm@next

source