Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install fails #27

Open
radhakrishnan-chandarasikharan-kr opened this issue Feb 1, 2023 · 3 comments
Open

npm install fails #27

radhakrishnan-chandarasikharan-kr opened this issue Feb 1, 2023 · 3 comments

Comments

@radhakrishnan-chandarasikharan-kr

Fails on installing canvas dependency

npm ERR! code 1
npm ERR! path /Users/me/Projects/Other/jsonata-exerciser/jsonata-exerciser/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute '/usr/local/Cellar/node/19.3.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/me/Projects/Other/jsonata-exerciser/jsonata-exerciser/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/me/Projects/Other/jsonata-exerciser/jsonata-exerciser/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v111' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@0.11.0
npm ERR! node-pre-gyp info using node@19.3.0 | darwin | x64
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "/Users/me/Projects/Other/jsonata-exerciser/jsonata-exerciser/node_modules/canvas/build/Release/canvas.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v111-darwin-unknown-x64.tar.gz
npm ERR! node-pre-gyp http 404 https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v111-darwin-unknown-x64.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v111-darwin-unknown-x64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for canvas@2.6.1 and node@19.3.0 (node-v111 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v111-darwin-unknown-x64.tar.gz

@wbrco
Copy link

wbrco commented Mar 15, 2023

Same issue. Install log attached.
npm@9.6.1 and node@v18.13.0
allen@debian:/etc$ cat debian_version
11.6
allen@debian:~/.local/bin/jsonata-exerciser$ uname -r
5.10.0-21-amd64

2023-03-15T21_30_32_842Z-debug-0.log

@mattbaileyuk
Copy link
Member

Looks like the above issue is caused by canvas being pinned back in package-lock.json (and being unable to find 2.6.1 compatible with Node.js 18 it tries to build it and fails); if I do npm i canvas to pick up a new version of that package and its dependencies then I am then able to do an npm i and successfully install.

However... npm start then fails with Error: error:0308010C:digital envelope routines::unsupported which looks like an issue with SSL versions on Node.js 18, and specifically in Webpack 4. You can work around this with export NODE_OPTIONS=--openssl-legacy-provider and then the execiser starts up fine. It's not a workaround I would want to document here, and I won't put in the install fix with the execution still broken.

What's really needed here is a bigger effort needed to get this library to Webpack 5 to get a properly working solution for Node.js 18+

@Chenneelavelan
Copy link

To Solve this.. you have to install nvm (Node Version Manager)
and change your node version to v16.. then if you try npm install and npm start.. they will work..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants