Automattic / node-canvas

Node canvas is a Cairo backed Canvas implementation for NodeJS.
10.18k stars 1.17k forks source link

Failed to install on latest macOS #1728

Open doodlewind opened 3 years ago

doodlewind commented 3 years ago

Issue or Feature

Bug

Steps to Reproduce

$ npm install canvas 

> canvas@2.6.1 install /Users/ewind/code/tmp/node_modules/canvas
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp ERR! Completion callback never invoked! 
node-pre-gyp ERR! System Darwin 20.2.0
node-pre-gyp ERR! command "/Users/ewind/.nvm/versions/node/v14.15.4/bin/node" "/Users/ewind/code/tmp/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/ewind/code/tmp/node_modules/canvas
node-pre-gyp ERR! node -v v14.15.4
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!     <https://github.com/mapbox/node-pre-gyp/issues>
npm WARN enoent ENOENT: no such file or directory, open '/Users/ewind/code/tmp/package.json'
npm WARN tmp No description
npm WARN tmp No repository field.
npm WARN tmp No README data
npm WARN tmp No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 6
npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 6
npm ERR! 
npm ERR! Failed at the canvas@2.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ewind/.npm/_logs/2021-01-08T18_07_22_872Z-debug.log

Your Environment

Note that neither can I install the 2.6.1 version with WSL2, am I using some wrong configuration? I have http_proxy set when performing npm install or yarn add.

zbjornson commented 3 years ago

Are you still experiencing this issue? The error says it's a bug in node-pre-gyp. There's an open PR to update node-pre-gyp, but I can't reproduce the issue with our current version.

gabriel-kohen-by commented 3 years ago

Just ran into the same with version 2.6.1 of canvas on MacOS(10.15.7). See attached log. This is become a show stopper for our teams and we are considering alternative which is a share because if such a great library. Ideas? 2021-03-14T13_05_06_984Z-debug.log I've also attached the error log when trying to move to 2.7.0 which also failed. Trying to upgrade to2-7-0 2021-03-14T13_18_15_587Z-debug.log

zbjornson commented 3 years ago

@gabriel-kohen-by thanks for the log, but unfortunately there's nothing helpful in it, just that it failed:

4786 silly install canvas@2.7.0
4787 info lifecycle canvas@2.7.0~install: canvas@2.7.0
4788 verbose lifecycle canvas@2.7.0~install: unsafe-perm in lifecycle true
4789 verbose lifecycle canvas@2.7.0~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/gabrielkohen/Documents/git/lui/plat-lui-exception-mfe/node_modules/canvas/node_modules/.bin:/Users/gabrielkohen/Documents/git/lui/plat-lui-exception-mfe/node_modules/.bin:/Users/gabrielkohen/.rvm/gems/ruby-2.7.0/bin:/Users/gabrielkohen/.rvm/gems/ruby-2.7.0@global/bin:/Users/gabrielkohen/.rvm/rubies/ruby-2.7.0/bin:/usr/local/opt/gnu-sed/libexec/gnubin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/gabrielkohen/Documents/git/lui/plat-lui-exception-mfe/node_modules/.bin:/Users/gabrielkohen/Library/apache-maven-3.6.3/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/gabrielkohen/.rvm/bin
4790 verbose lifecycle canvas@2.7.0~install: CWD: /Users/gabrielkohen/Documents/git/lui/plat-lui-exception-mfe/node_modules/canvas
4791 silly lifecycle canvas@2.7.0~install: Args: [ '-c', 'node-pre-gyp install --fallback-to-build' ]
4792 silly lifecycle canvas@2.7.0~install: Returned: code: 1  signal: null
4793 info lifecycle canvas@2.7.0~install: Failed to exec install script

That could be a permissions problem, but I'm just guessing.

Note that this is a different issue than the OP.