【发布时间】:2019-01-09 16:49:42
【问题描述】:
我无法在 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 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
【问题讨论】:
标签: command-line ionic3 fabricjs angular6 node-gyp