gpt4 book ai didi

node.js - npm install 出现错误

转载 作者:太空宇宙 更新时间:2023-11-03 21:53:16 25 4
gpt4 key购买 nike

我无法成功使用 npm 安装软件包$npm install 之后,它显示以下输出:

> canvas@1.6.7 install /home/samuel/testes/Avanade Angular Academy by Gama/gama-avanade-tryout01/node_modules/canvas
> node-gyp rebuild

./util/has_lib.sh: 31: ./util/has_lib.sh: pkg-config: not found
gyp: Call to './util/has_lib.sh freetype' returned exit status 0 while in binding.gyp. 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 (/home/samuel/.npm-global/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
gyp ERR! System Linux 4.9.0-4-amd64
gyp ERR! command "/usr/bin/node" "/home/samuel/.npm-global/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/samuel/testes/Avanade Angular Academy by Gama/gama-avanade-tryout01/node_modules/canvas
gyp ERR! node -v v6.12.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@1.6.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.6.7 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/samuel/.npm/_logs/2017-12-12T02_40_55_700Z-debug.log

我该怎么办?感谢大家的帮助!

最佳答案

解决方案是安装一些外部依赖项。下面的命令就足够了。

$ sudo apt-get update 
$ sudo apt-get install libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++

之后,$npm install 就可以工作了!

关于node.js - npm install 出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47764620/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com