2014-01-15 286 views
0

我正在嘗試使用node.js工作在Android/ios的PUSh通知上。 當我嘗試安裝xml2json時,出現以下錯誤。 請幫我解決它npm install xml2json無法安裝

gyp ERR! build error 
gyp ERR! stack Error: not found: make 
gyp ERR! stack  at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28) 
gyp ERR! stack  at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29) 
gyp ERR! stack  at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16 
gyp ERR! stack  at Object.oncomplete (fs.js:107:15) 
gyp ERR! System Darwin 12.5.0 
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 
gyp ERR! cwd /Users/bertils/node_modules/xml2json/node_modules/node-expat 
gyp ERR! node -v v0.10.24 
gyp ERR! node-gyp -v v0.12.1 
gyp ERR! not ok 
npm ERR! [email protected] install: `node-gyp rebuild` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] install script. 
npm ERR! This is most likely a problem with the node-expat 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 node-expat 
npm ERR! There is likely additional logging output above. 

npm ERR! System Darwin 12.5.0 
npm ERR! command "node" "/usr/local/bin/npm" "install" "xml2json" 
npm ERR! cwd /Users/bertils 
npm ERR! node -v v0.10.24 
npm ERR! npm -v 1.3.21 
npm ERR! code ELIFECYCLE 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /Users/bertils/npm-debug.log 
npm ERR! not ok code 0 

回答

1

貌似make工具不可用您的系統上。

爲了解決這個問題,你有兩個選擇:

  • 如果您已經安裝Xcode

轉到Xcode > Preferences > Downloads並安裝名爲「命令行工具」的組件。所有相關工具將被放置在/usr/bin中。

  • 備選:

轉到https://developer.apple.com/downloads,請使用您的開發人員的Apple ID,然後搜索「命令行工具」,然後下載並安裝相應的文件。

+0

謝謝安裝命令行工具後,它工作:) –