node-gyp rebuild fails && brew update 报错 Error: Could not link:

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 (/usr/local/lib/node_modules/tnpm/node_modules/_node-gyp@3.7.0@node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/tnpm/node_modules/_npminstall@3.10.0@npminstall/node-gyp-bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/wyc/test/fabric-test/node_modules/_canvas@1.6.13@canvas
gyp ERR! node -v v10.12.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
[canvas@^1.6.13] optional install error: Error: Run "sh -c node-gyp rebuild" error, exit code 1
    at ChildProcess.proc.on.code (/usr/local/lib/node_modules/tnpm/node_modules/_runscript@1.3.0@runscript/index.js:74:29)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: canvas@1.6.13 (node_modules/canvas):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: canvas@1.6.13 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

解决办法:

brew install pkg-config
brew install cairo
npm install canvas


brew update 报错 Error: Could not link: 

Error: Could not link:
/usr/local/etc/bash_completion.d/brew

Please delete these paths and run `brew upDate`.
Error: Could not link:
/usr/local/share/zsh/site-functions/_brew

Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/man/man1/brew.1

Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/doc/homebrew

Please delete these paths and run `brew update`.

解决办法:

rm -rf /usr/local/etc/bash_completion.d/brew
rm -rf /usr/local/share/zsh/site-functions/_brew
rm -rf /usr/local/share/man/man1/brew.1
rm -rf /usr/local/share/doc/homebrew
brew update


本文标题:node-gyp rebuild fails && brew update 报错 Error: Could not link:
本文链接:https://56way.com/p/122.html
作者授权:除特别说明外,本文由 无路 原创编译并授权 小无路 刊载发布。
版权声明:本文不使用任何协议授权,您可以任何形式自由转载或使用。

发表评论

必填

选填

选填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。