2016-01-12 50 views
0

我無法在nodejs中使用net:ping模塊。當我試圖安裝模塊,它給了我下面的錯誤..請幫助由於錯誤而無法安裝net :: ping [email protected]安裝腳本'node-gyp rebuild'

npm install net-ping 
[email protected] install /root/node_modules/raw-socket 
node-gyp rebuild 
Traceback (most recent call last): 
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in <module> 
sys.exit(gyp.script_main()) 
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 545, in script_main 
return main(sys.argv[1:]) 
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 538, in main 
return gyp_main(args) 
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 514, in gyp_main 
options.duplicate_basename_check) 
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 130, in Load 
params['parallel'], params['root_targets']) 
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2775, in Load 
variables, includes, depth, check, True) 
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 391, in LoadTargetBuildFile 
includes, True, check) 
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 243, in LoadOneBuildFile 
None) 
File "binding.gyp", line 1 
{ 
^ 
SyntaxError: invalid syntax 
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1 
gyp ERR! stack  at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16) 
gyp ERR! stack  at emitTwo (events.js:87:13) 
gyp ERR! stack  at ChildProcess.emit (events.js:172:7) 
gyp ERR! stack  at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) 
gyp ERR! System Linux 2.6.32-504.12.2.el6.x86_64 
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /root/node_modules/raw-socket 
gyp ERR! node -v v5.4.0 
gyp ERR! node-gyp -v v3.2.1 
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/root/package.json' 
npm WARN root No description 
npm WARN root No repository field. 
npm WARN root No README data 
npm WARN root No license field. 
npm ERR! Linux 2.6.32-504.12.2.el6.x86_64 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "net-ping" 
npm ERR! node v5.4.0 
npm ERR! npm v3.5.3 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] install: `node-gyp rebuild` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, 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 information on how to open an issue for this project with: 
npm ERR!  npm bugs raw-socket 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls raw-socket 
npm ERR! There is likely additional logging output above. 
npm ERR! Please include the following file with any support request: 
npm ERR!  /root/npm-debug.log 

感謝&問候 TEJ普拉塔普Bisht

+0

您是否真的讀過錯誤信息? – SmokeDispenser

+0

謝謝Jan的回覆。我檢查了錯誤信息。我只能猜測,我使用的節點和npm版本不兼容?這是你想告訴我的嗎? –

+0

你在開玩笑嗎?它說得很清楚。檢查nods.js和npm是最新的。如果沒有,更新。如果是,請告訴失敗包的作者。 – SmokeDispenser

回答

0

升級到node.It的最新版本爲我工作的版本0.12.0(nvm install 0.12.0)

相關問題