Command line 无法在Mac OS上安装fabric.js
我无法在mac os上安装fabric js。目前正在从事爱奥尼亚项目。下面是我的项目配置 1。爱奥尼亚-v3 2。角度-v6 3。科尔多瓦 我在终端上按命令运行 npm i织物 但我犯了错误Command line 无法在Mac OS上安装fabric.js,command-line,ionic3,fabricjs,angular6,node-gyp,Command Line,Ionic3,Fabricjs,Angular6,Node Gyp,我无法在mac os上安装fabric js。目前正在从事爱奥尼亚项目。下面是我的项目配置 1。爱奥尼亚-v3 2。角度-v6 3。科尔多瓦 我在终端上按命令运行 npm i织物 但我犯了错误 Mobiles-MacBook-Pro:lib mobilesolution$ npm i fabric > canvas@1.6.11 install /usr/local/lib/node_modules/fabric/node_modules/canvas > node-gyp reb
Mobiles-MacBook-Pro:lib mobilesolution$ npm i fabric
> canvas@1.6.11 install /usr/local/lib/node_modules/fabric/node_modules/canvas
> node-gyp rebuild
./util/has_lib.sh: line 31: pkg-config: command 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack at ChildProcess.emit (events.js:160:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/Cellar/node/9.4.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/fabric/node_modules/canvas
gyp ERR! node -v v9.4.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: canvas@1.6.11 (node_modules/fabric/node_modules/canvas):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: canvas@1.6.11 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
+ fabric@2.3.3
added 82 packages from 192 contributors in 4.071s
我尝试了这么多的解决方案,但都不管用。甚至我也试图更新操作系统版本。尽管我发现了同样的问题。我尝试了以下命令
cd /usr/local/lib sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib
sudo apt-get install build-essential
received error as apt-get not defined
apt-get remove gyp
xcode-select --install
sudo xcode-select --switch
node-gyp configure
sudo xcode-select -s /Library/Developer/CommandLineTools
softwareupdate --install -a
我找到了解决办法。我忘了安装开罗 我跟着林克找到了答案。现在它可以正常工作了。能够安装fabric.js 我按命令跑
brew install cairo
brew install pkg-config
我还必须将
libffi
添加到$PKG\u CONFIG\u PATH
as。