Automattic / node-canvas

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

NPM installer crashes at the `canvas install script` on Ubuntu 19.10 #1505

Closed amyipdev closed 4 years ago

amyipdev commented 4 years ago

I'm trying to install Canvas

Issue or Feature

https://paste.ubuntu.com/p/dYP7snvndx/

Steps to Reproduce

sudo apt install nodejs
sudo apt install npm
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
sudo npm i canvas

Your Environment

muffeeee commented 4 years ago

Try using a lower nodejs version; node-canvas installs fine for me on node v8.

I'm guessing this package isn't ready yet for node v10+

zbjornson commented 4 years ago
1898 verbose stack Error: canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
1898 verbose stack Exit status 1
1898 verbose stack     at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:283:16)

Unfortunately that message isn't useful. I'd try

  1. Installing without sudo, npm i canvas.
  2. Cloning this repo and running npm install in this directory. You'll get more output from the actual build. (yarn might also give more info.)

I'm guessing this package isn't ready yet for node v10+

node-canvas works with v8-v13.

amyipdev commented 4 years ago

@zbjornson I've figured out the problem. Node (recently updated to v13) is preventing me from installing libnode64 and libnode-dev, which is required for node-gyp, which is crashing the installer as there is no directory for node-gyp making it give a Permission denied error. Basically I just need to find a way to tell Node's dependencies to shut up.

zbjornson commented 4 years ago

I'm not sure without more specifics, but that still sounds like it could be caused by using sudo with npm i canvas. Did you try without sudo?

LinusU commented 4 years ago

If you're still hitting this issue after trying the suggestion from zbjornson, please leave a comment and I'll re-open.