Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 在NPM不工作的情况下安装节点画布_Node.js_Canvas_Centos - Fatal编程技术网

Node.js 在NPM不工作的情况下安装节点画布

Node.js 在NPM不工作的情况下安装节点画布,node.js,canvas,centos,Node.js,Canvas,Centos,我正在尝试使用LAMP在CentOs 6上安装节点画布。我已经安装并更新了Node JS至最新版本,以及nmp 当我运行命令:npm install canvas时,我只得到以下错误: [root@localhost tmp]# sudo npm install canvas > canvas@1.2.1 install /tmp/node_modules/canvas > node-gyp rebuild Package pangocairo was not found in

我正在尝试使用LAMP在CentOs 6上安装节点画布。我已经安装并更新了Node JS至最新版本,以及nmp

当我运行命令:npm install canvas时,我只得到以下错误:

[root@localhost tmp]# sudo npm install canvas

> canvas@1.2.1 install /tmp/node_modules/canvas
> node-gyp rebuild

Package pangocairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `pangocairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pangocairo' found
gyp: Call to 'pkg-config pangocairo --libs' returned exit status 1. 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/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 2.6.32-504.8.1.el6.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/node_modules/canvas
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 2.6.32-504.8.1.el6.x86_64
npm ERR! argv "node" "/usr/bin/npm" "install" "canvas"
npm ERR! node v0.10.36
npm ERR! npm  v2.7.1
npm ERR! code ELIFECYCLE

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

npm ERR! Please include the following file with any support request:
npm ERR!     /tmp/npm-debug.log

在安装节点画布之前,需要安装cairo和其他一些库

只需使用以下命令:

yum安装-y cairo-cairom-devel-libjpeg-turbo-devel-pango-pango-devel-pangom-pangom-devel