Running into ELIFECYCLE error while trying to install filebazaar

1

Trying to install filebazaar on Ubuntu 18.04 and getting an error on the canvas module... anyone familiar with this issue? I've been all over node-canvas's github issues (such as this one where I left a comment), but none of the solutions are working for me so far.

Here's the command I'm running:

$ sudo npm install -g filebazaar

And here's the error output:

$ sudo npm install -g canvas@1.6.13

> canvas@1.6.13 install /usr/local/lib/node_modules/canvas
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/canvas/build'
gyp ERR! System Linux 4.15.0-55-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/canvas
gyp ERR! node -v v12.5.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@1.6.13 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@1.6.13 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/chris/.npm/_logs/2019-09-17T20_39_13_514Z-debug.log

Any assistance is appreciated :)

Chris Guida

Posted 2019-09-17T21:02:57.297

Reputation: 11

Answers

0

Maybe the directory doesnt have the proper rights, try this command sudo chmod 777

If it still doesnt work try these flag before your install sudo npm install -g --unsafe-perm

or sudo node-gyp rebuild -g --unsafe-perm

then try again

Saxtheowl

Posted 2019-09-17T21:02:57.297

Reputation: 1 148

Maybe the directory doesnt have the proper rights, try this command sudo chmod 777: Which directory are you referring to?Chris Guida 2019-09-18T20:29:19.777

/usr/local/lib/node_modules/canvas see this thread also https://stackoverflow.com/questions/42308879/npm-err-code-elifecycle

Saxtheowl 2019-09-18T20:35:50.437

You're right, I didn't have permission on a number of directories, including /usr/local/lib/node_modules.Chris Guida 2019-10-08T16:01:40.650

0

I figured out the issue: there were some directories that were owned by root that needed to be owned by my user.

I made myself owner of some npm-related folders, for instance:

sudo chown -R `whoami` /usr/local/lib/node_modules

...and that seems to have fixed the issue.

Chris Guida

Posted 2019-09-17T21:02:57.297

Reputation: 11

0

Configuring npm to install global packages to your user directory goes a long way to make these pesky permission issues go away.

See: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally#manually-change-npms-default-directory

shesek

Posted 2019-09-17T21:02:57.297

Reputation: 546