简体   繁体   English

npm安装PDFkit失败

[英]npm install PDFkit fails

I'm trying to install PDFKit for node.js using the recommended command: 我正在尝试使用建议的命令为node.js安装PDFKit:

npm install pdfkit

However it fails with the following messages: 但是它失败并显示以下消息:

zlib@1.0.5 preinstall /home/woody/node_modules/pdfkit/node_modules/zlib node-waf clean || zlib@1.0.5 preinstall / home / woody / node_modules / pdfkit / node_modules / zlib node-waf clean || true; 真正; node-waf configure build node-waf配置构建

sh: node-waf: not found
sh: node-waf: not found
npm ERR! error installing zlib@1.0.5 Error: zlib@1.0.5 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! error installing zlib@1.0.5 `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 127
npm ERR! error installing zlib@1.0.5     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing zlib@1.0.5     at ChildProcess.emit (events.js:67:17)
npm ERR! error installing zlib@1.0.5     at ChildProcess.onexit (child_process.js:192:12)
npm ERR! error installing pdfkit@0.1.5 Error: zlib@1.0.5 preinstall: `node-waf clean || true; node-waf configure build`
npm ERR! error installing pdfkit@0.1.5 `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 127
npm ERR! error installing pdfkit@0.1.5     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing pdfkit@0.1.5     at ChildProcess.emit (events.js:67:17)
npm ERR! error installing pdfkit@0.1.5     at ChildProcess.onexit (child_process.js:192:12)
npm ERR! zlib@1.0.5 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 zlib@1.0.5 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

I'm running Ubuntu 10.04.3 LTS 我正在运行Ubuntu 10.04.3 LTS

If anyone has any help or suggestions, that'd be great - thanks. 如果有人有任何帮助或建议,那就太棒了 - 谢谢。

你需要安装nodejs-dev包:

sudo apt-get install nodejs-dev

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM