在linux上安装npm模块(打印机)时出错

时间:2015-03-18 12:31:49

标签: linux node.js module installation printers

我正在尝试在 lubuntu 系统上为节点安装printer module,但是进行npm安装,我明白了:

gyp: Call to 'cups-config --libs' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:344:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.16.0-23-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/puesto1/app/node_modules/printer
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! printer@0.1.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the printer@0.1.1 install script.
npm ERR! This is most likely a problem with the printer 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 printer
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.16.0-23-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/puesto1/app
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/puesto1/app/npm-debug.log
npm ERR! not ok code 0

这是最近安装的lubuntu,我不知道该怎么做。有什么建议可以解决这个问题吗?还有其他要打印的模块吗?

谢谢。

1 个答案:

答案 0 :(得分:3)

我认为node-gyp在您的系统中不是最新的,并且还没有安装cups-config,尝试使用apt-get使用以下命令重新安装node-gyp: sudo apt-get install node -gyp 并使用以下命令安装cups-config: sudo apt-get install libcups2-dev