2013-05-04 27 views
2

我想在我的nodejs上安裝net-ping模塊,但在原始插座安裝階段出現奇怪的錯誤。安裝原始插座時node-gyp構建錯誤

我在編譯nodejs源代碼進行安裝時遇到了同樣的問題flock,但是我添加了LINK=g++ make,問題解決了。有什麼辦法解決這個問題?


我試過alias ='LINK = g ++ make',但它沒有奏效!

$ npm install net-ping 
npm http GET https://registry.npmjs.org/net-ping 
npm http 304 https://registry.npmjs.org/net-ping 
npm http GET https://registry.npmjs.org/raw-socket 
npm http 304 https://registry.npmjs.org/raw-socket 

> [email protected] install /root/projectsrc/node_modules/net-ping/node_modules/raw-socket 
> node-gyp rebuild 

make: Entering directory `/root/projectsrc/node_modules/net-ping/node_modules/raw-socket/build' 
    g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/0.8.23/src -I/root/.node-gyp/0.8.23/deps/uv/include -I/root/.node-gyp/0.8.23/deps/v8/include -Wall -pthread -m32 -O2 -fno-strict-aliasing -fno-tree-vrp -fno-tree-sink -fno-rtti -fno-exceptions -MMD -MF ./Release/.deps/Release/obj.target/raw/src/raw.o.d.raw -c -o Release/obj.target/raw/src/raw.o ../src/raw.cc 
    flock ./Release/linker.lock g++ -shared -pthread -rdynamic -m32 -Wl,-soname=raw.node -o Release/obj.target/raw.node -Wl,--start-group Release/obj.target/raw/src/raw.o -Wl,--end-group 
./Release/linker.lock: No such file or directory 
make: *** [Release/obj.target/raw.node] Error 3 
make: Leaving directory `/root/projectsrc/node_modules/net-ping/node_modules/raw-socket/build' 
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2 
gyp ERR! stack  at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) 
gyp ERR! stack  at ChildProcess.EventEmitter.emit (events.js:99:17) 
gyp ERR! stack  at Process._handle.onexit (child_process.js:680:10) 
gyp ERR! System Linux 2.6.11-1.1369_FC4 
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /root/projectsrc/node_modules/net-ping/node_modules/raw-socket 
gyp ERR! node -v v0.8.23 
gyp ERR! node-gyp -v v0.9.5 
gyp ERR! not ok 
npm ERR! [email protected] install: `node-gyp rebuild` 
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1 
npm ERR! 
npm ERR! Failed at the [email protected] install script. 
npm ERR! This is most likely a problem with the raw-socket 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 raw-socket 
npm ERR! There is likely additional logging output above. 

npm ERR! System Linux 2.6.11-1.1369_FC4 
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "net-ping" 
npm ERR! cwd /root/projectsrc 
npm ERR! node -v v0.8.23 
npm ERR! npm -v 1.2.18 
npm ERR! code ELIFECYCLE 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /root/projectsrc/npm-debug.log 
npm ERR! not ok code 0 
+0

有此問題。你有沒有設法解決它? – 2014-07-27 15:09:09

回答

0

有同樣的問題。

  • 確保您已安裝python2.7,makegcc
  • 使用一個偶數節點版本, G。 0.10.x而不是奇數,例如。 G。 0.11.x

後者的建議解決了我的問題。 Source

相關問題