npm ERR! code 1
npm ERR! path /Volumes/D/HTML/vscodework/react/my-app/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! Package pangocairo was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `pangocairo.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No package 'pangocairo' found
npm ERR! gyp: Call to 'pkg-config pangocairo --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/Volumes/D/HTML/vscodework/react/my-app/node_modules/node-gyp/lib/configure.js:351:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:400:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! gyp ERR! System Darwin 20.6.0
npm ERR! gyp ERR! command "/usr/local/bin/node" "/Volumes/D/HTML/vscodework/react/my-app/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Volumes/D/HTML/vscodework/react/my-app/node_modules/canvas
npm ERR! gyp ERR! node -v v14.17.5
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
解决问题:安装依赖库
brew install pkg-config cairo pango
查了下这几库的作用:
pkg-config :返回安装库信息用的
cairo:一个绘图免费库
pango:一个自由函数库
查了也不知道干啥得,反正是好了!