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

Can't install Canvas on Node 12.3.1 #1429

Closed
munawarb opened this issue May 23, 2019 · 6 comments
Closed

Can't install Canvas on Node 12.3.1 #1429

munawarb opened this issue May 23, 2019 · 6 comments

Comments

@munawarb
Copy link

Issue or Feature

I can't install Canvas on NodeJS 12.3.1.

Steps to Reproduce

node --version
v12.3.1
sudo npm install canvas --save
[..................] / rollbackFailedOptional: verb npm-session 647126bd76582ff
[..................] / rollbackFailedOptional: verb npm-session 647126bd76582ff
[..................] / rollbackFailedOptional: verb npm-session 647126bd76582ff
[..................] / rollbackFailedOptional: verb npm-session 647126bd76582ff
[..................] / rollbackFailedOptional: verb npm-session 647126bd76582ff
[..................] / rollbackFailedOptional: verb npm-session 647126bd76582ff
[..................] / rollbackFailedOptional: verb npm-session 647126bd76582ff
[..................] / rollbackFailedOptional: verb npm-session 647126bd76582ff
[..................] / rollbackFailedOptional: verb npm-session 647126bd76582ff
[..................] | loadIdealTree:loadAllDepsIntoIdealTree: sill install loa
[..................] - fetchMetadata: sill removeObsoleteDep removing simple-co
[..................] / fetchMetadata: sill removeObsoleteDep removing simple-co
[  ................] \ loadDep:util-deprecate: sill resolveWithNewModule simple
[  ................] \ fetchMetadata: sill resolveWithNewModule simple-get@3.0.
[  ................] \ fetchMetadata: sill resolveWithNewModule simple-get@3.0.
[  ................] \ fetchMetadata: sill resolveWithNewModule decompress-resp
[      ............] / loadExtraneous: sill resolveWithNewModule mimic-response
[      ............] / loadExtraneous: sill resolveWithNewModule mimic-response
[      ............] / loadExtraneous: sill resolveWithNewModule mimic-response
[      ............] / loadExtraneous: sill resolveWithNewModule mimic-response
[      ............] / loadExtraneous: sill resolveWithNewModule mimic-response
[      ............] - diffTrees: sill install generateActionsToTake
[       ...........] \ postinstall: sill install executeActions
[       ...........] - extract:canvas: verb lock using /home/munawar/.npm/_lock
[          ........] \ extract:nan: sill extract nan@^2.13.2 extracted to /home
> canvas@2.5.0 install /home/munawar/ethanalyzerhost/node_modules/canvas
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Pre-built binaries not installable for canvas@2.5.0 and node@12.3.1 (node-v72 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/home/munawar/ethanalyzerhost/node_modules/canvas/build' 
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/munawar/ethanalyzerhost/node_modules/canvas/build'
gyp ERR! System Linux 4.4.0-142-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/munawar/ethanalyzerhost/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/munawar/ethanalyzerhost/node_modules/canvas/build/Release" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /home/munawar/ethanalyzerhost/node_modules/canvas
gyp ERR! node -v v12.3.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/munawar/ethanalyzerhost/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/munawar/ethanalyzerhost/node_modules/canvas/build/Release --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/munawar/ethanalyzerhost/node_modules/canvas/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
node-pre-gyp ERR! System Linux 4.4.0-142-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/munawar/ethanalyzerhost/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/munawar/ethanalyzerhost/node_modules/canvas
node-pre-gyp ERR! node -v v12.3.1
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/munawar/ethanalyzerhost/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/munawar/ethanalyzerhost/node_modules/canvas/build/Release --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm WARN ethanalyzerhost@1.0.0 No description
npm WARN ethanalyzerhost@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@2.5.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@2.5.0 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!     /home/munawar/.npm/_logs/2019-05-23T15_15_56_356Z-debug.log
munawar@iot:~/ethanalyzerhost$ 

Your Environment

  • Version of node-canvas (output of npm list canvas or yarn list canvas):2.5
  • Environment (e.g. node 4.2.0 on Mac OS X 10.8): node 12.3.1 on Ubuntu
@munawarb
Copy link
Author

Turned out to be a permissions issue. My node_modules folder and ~/.npm were owned by root. I took ownership with my local user and it worked.

@wpitallo
Copy link

@munawarb How do you take permission?

@munawarb
Copy link
Author

Hi @wpitallo,
You can execute this command:

sudo chown -R USERNAME:USERNAME ~/.npm
sudo chown -R USERNAME:USERNAME ~/PROJECT_DIR/node_modules

Good luck!

@wpitallo
Copy link

@munawarb thank you!

@munawarb
Copy link
Author

@wpitallo You're welcome!

@tokarev-i-v
Copy link

There is my solution: #1023 (comment)

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

3 participants