2011-10-07 137 views
1

我試圖安裝PDFKit使用推薦的命令的node.js:NPM安裝PDFkit失敗

npm install pdfkit 

然而,它失敗,出現以下消息:

[email protected]預裝/ home/woody/node_modules/pdfkit/node_modules/zlib node-waf clean ||真正;節點WAF配置構建

sh: node-waf: not found 
sh: node-waf: not found 
npm ERR! error installing [email protected] Error: [email protected] preinstall: `node-waf clean || true; node-waf configure build` 
npm ERR! error installing [email protected] `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 127 
npm ERR! error installing [email protected]  at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/exec.js:49:20) 
npm ERR! error installing [email protected]  at ChildProcess.emit (events.js:67:17) 
npm ERR! error installing [email protected]  at ChildProcess.onexit (child_process.js:192:12) 
npm ERR! error installing [email protected] Error: [email protected] preinstall: `node-waf clean || true; node-waf configure build` 
npm ERR! error installing [email protected] `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 127 
npm ERR! error installing [email protected]  at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/exec.js:49:20) 
npm ERR! error installing [email protected]  at ChildProcess.emit (events.js:67:17) 
npm ERR! error installing [email protected]  at ChildProcess.onexit (child_process.js:192:12) 
npm ERR! [email protected] preinstall: `node-waf clean || true; node-waf configure build` 
npm ERR! `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 127 
npm ERR! 
npm ERR! Failed at the [email protected] preinstall script. 
npm ERR! This is most likely a problem with the zlib package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  node-waf clean || true; node-waf configure build 
npm ERR! You can get their info via: 
npm ERR!  npm owner ls zlib 
npm ERR! There is likely additional logging output above. 
npm ERR! 
npm ERR! System Linux 2.6.32-33-generic-pae 
npm ERR! command "node" "/usr/bin/npm" "install" "pdfkit" 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /home/woody/npm-debug.log 
npm not ok 

我運行Ubuntu 10.04.3 LTS

如果任何人有任何幫助或建議,那簡直太好了 - 謝謝。

+0

你是如何安裝的node.js? – thejh

+0

sudo apt-get install nodejs – Woody

回答

4

您需要安裝的NodeJS-dev軟件包:

sudo apt-get install nodejs-dev 
+0

工作,謝謝。 :) – Woody

+0

嗨,我有像我看到node-waf未找到相同的問題。任何想法如何我可以在Windows 8上安裝nodejs-dev ... – praveenb