VisActor / VChart

VChart, more than just a cross-platform charting library, but also an expressive data storyteller.
https://www.visactor.io/vchart
MIT License
899 stars 61 forks source link

[Bug] Execute “rush update",there is a erro on installing node-canvas #608

Closed xuanhun closed 1 year ago

xuanhun commented 1 year ago

Version

1.2.0

Link to Minimal Reproduction

https://github.com/VisActor/VChart/

Steps to Reproduce

  1. Clone the code
  2. run "rush update"

Current Behavior

There is a error:

.../canvas@2.11.2/node_modules/canvas install$ node-pre-gyp install --fallback-to-build --update-binary
│ node-pre-gyp info it worked if it ends with ok
│ node-pre-gyp info using node-pre-gyp@1.0.11
│ node-pre-gyp info using node@18.16.1 | darwin | arm64
│ node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v108-darwin-unknown-arm64.tar.gz
│ node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-
│ node-pre-gyp WARN Pre-built binaries not installable for canvas@2.11.2 and node@18.16.1 (node-v108 ABI, unknown) (falling back to source compi
│ node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@9.3.1
│ gyp info using node@18.16.1 | darwin | arm64
│ gyp info ok 
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@9.3.1
│ gyp info using node@18.16.1 | darwin | arm64
│ gyp info find Python using Python version 3.9.6 found at "/Library/Developer/CommandLineTools/usr/bin/python3"
│ gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
│ gyp info spawn args [
│ gyp info spawn args   '/.rush/node-v18.16.1/pnpm-7.32.1/node_modules/pnpm/dist/node_modules/node-gyp/gyp/gyp_main.py',
│ gyp info spawn args   'binding.gyp',
│ gyp info spawn args   '-f',
│ gyp info spawn args   'make',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/Documents/code/VChart/common/temp/node_modules/.pnpm/canvas@2.11.2/node_modules/canvas/build/config.gy
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/.rush/node-v18.16.1/pnpm-7.32.1/node_modules/pnpm/dist/node_modules/node-gyp/addon.gypi',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/Library/Caches/node-gyp/18.16.1/include/node/common.gypi',
│ gyp info spawn args   '-Dlibrary=shared_library',
│ gyp info spawn args   '-Dvisibility=default',
│ gyp info spawn args   '-Dnode_root_dir=/Library/Caches/node-gyp/18.16.1',
│ gyp info spawn args   '-Dnode_gyp_dir=/.rush/node-v18.16.1/pnpm-7.32.1/node_modules/pnpm/dist/node_modules/node-gyp',
│ gyp info spawn args   '-Dnode_lib_file=Library/Caches/node-gyp/18.16.1/<(target_arch)/node.lib',
│ gyp info spawn args   '-Dmodule_root_dir=/code/VChart/common/temp/node_modules/.pnpm/canvas@2.11.2/node_modules/canv
│ gyp info spawn args   '-Dnode_engine=v8',
│ gyp info spawn args   '--depth=.',
│ gyp info spawn args   '--no-parallel',
│ gyp info spawn args   '--generator-output',
│ gyp info spawn args   'build',
│ gyp info spawn args   '-Goutput_dir=.'
│ gyp info spawn args ]
│ /bin/sh: pkg-config: command not found
│ gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 127 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 (/.rush/node-v18.16.1/pnpm-7.32.1/node_modules/pnpm/dist/node_modules/node-gyp/lib
│ gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
│ gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
│ gyp ERR! System Darwin 22.5.0
│ gyp ERR! command "/usr/local/bin/node" "/.rush/node-v18.16.1/pnpm-7.32.1/node_modules/pnpm/dist/node_modules/node-gyp/bin/node
│ gyp ERR! cwd /Documents/code/VChart/common/temp/node_modules/.pnpm/canvas@2.11.2/node_modules/canvas
│ gyp ERR! node -v v18.16.1
│ gyp ERR! node-gyp -v v9.3.1
│ gyp ERR! not ok 
│ node-pre-gyp ERR! build error 
│ node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /.rush/node-v18.16.1/pnpm-7.32.1/node_modules/pnpm/dist/
│ node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/code/VChart/common/temp/node_modules/.pnpm/@mapbox+node-pr
│ node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
│ node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
│ node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
│ node-pre-gyp ERR! System Darwin 22.5.0
│ node-pre-gyp ERR! command "/usr/local/bin/node" "Documents/code/VChart/common/temp/node_modules/.pnpm/@mapbox+node-pre-gyp@1.
│ node-pre-gyp ERR! cwd /Documents/code/VChart/common/temp/node_modules/.pnpm/canvas@2.11.2/node_modules/canvas
│ node-pre-gyp ERR! node -v v18.16.1
│ node-pre-gyp ERR! node-pre-gyp -v v1.0.11
│ node-pre-gyp ERR! not ok 
│ Failed to execute '/usr/local/bin/node /.rush/node-v18.16.1/pnpm-7.32.1/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-
└─ Failed in 2s at /code/VChart/common/temp/node_modules/.pnpm/canvas@2.11.2/node_modules/canvas
node_modules/.pnpm/ejs@2.7.4/node_modules/ejs: Running postinstall script, done in 42ms
node_modules/.pnpm/fsevents@1.2.13/node_modules/fsevents: Running install script, done in 1.4s
node_modules/.pnpm/swiper@6.8.0/node_modules/swiper: Running postinstall script, done in 49ms
 ELIFECYCLE  Command failed with exit code 1.

The command failed:
 /code/VChart/common/temp/pnpm-local/node_modules/.bin/pnpm install --store 
/code/VChart/common/temp/pnpm-store --config.cacheDir=
/code/VChart/common/temp/pnpm-store --config.stateDir=/code/VChart/common/temp/pnpm-store --no-prefer-frozen-lockfile --no-strict-peer-dependencies --config.ignoreCompatibilityDb --recursive --link-workspace-packages false
ERROR: Error: The command failed with exit code 1

Expected Behavior

There will not be any error

Environment

- OS:mac os
- Browser:
- Framework:

Any additional comments?

No response

xuanhun commented 1 year ago

https://github.com/Automattic/node-canvas,I found a solution here.

Using Homebrew: brew install pkg-config cairo pango libpng jpeg giflib librsvg pixman