Sharp: npm install fails on ubuntu 14.04

Created on 17 Nov 2016  Â·  2Comments  Â·  Source: lovell/sharp

My package.json has "sharp": "^0.16.2", I am installing as root (I have to unfortunately). I have nvm installed which currently points to 6.9.0.

root@ip-# node --version
v6.9.0
root@ip-# npm --version
3.10.8
root@# npm install

[email protected] install /home/ubuntu/myApp/node_modules/sharp
node-gyp rebuild

module.js:474
throw err;
^

Error: Cannot find module 'graceful-fs'
at Function.Module._resolveFilename (module.js:472:15)
at Function.Module._load (module.js:420:25)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Object. (/usr/share/node-gyp/lib/node-gyp.js:12:10)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
npm ERR! Linux 3.13.0-91-generic
npm ERR! argv "/root/.nvm/versions/node/v6.9.0/bin/node" "/root/.nvm/versions/node/v6.9.0/bin/npm" "install"
npm ERR! node v6.9.0
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.

question

Most helpful comment

The combination of using multiple node/npm/node-gyp versions via nvm and installing as root is probably going to cause all sorts of file-trampling problems :(

graceful-fs is a deeply-nested dependency:

$ npm ls --production graceful-fs
[email protected]
  [email protected]
    [email protected]
      [email protected]

Running npm install --unsafe-perm might "fix" this, or see possible "solutions"at http://stackoverflow.com/questions/11379919/npm-cannot-find-graceful-fs-no-matter-what-i-do

For future sanity, I recommend spending time removing the need to install as root. Good luck!

All 2 comments

The combination of using multiple node/npm/node-gyp versions via nvm and installing as root is probably going to cause all sorts of file-trampling problems :(

graceful-fs is a deeply-nested dependency:

$ npm ls --production graceful-fs
[email protected]
  [email protected]
    [email protected]
      [email protected]

Running npm install --unsafe-perm might "fix" this, or see possible "solutions"at http://stackoverflow.com/questions/11379919/npm-cannot-find-graceful-fs-no-matter-what-i-do

For future sanity, I recommend spending time removing the need to install as root. Good luck!

Thanks a lot Lovell Fuller

On 17 Nov 2016 10:20 PM, "Lovell Fuller" [email protected] wrote:

The combination of using multiple node/npm/node-gyp versions via nvm and
installing as root is probably going to cause all sorts of file-trampling
problems :(

graceful-fs is a deeply-nested dependency:

$ npm ls --production graceful-fs
[email protected]
[email protected]
[email protected]
[email protected]

Running npm install --unsafe-perm might "fix" this, or see possible
"solutions"at http://stackoverflow.com/questions/11379919/npm-cannot-
find-graceful-fs-no-matter-what-i-do

For future sanity, I recommend spending time removing the need to install
as root. Good luck!

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/lovell/sharp/issues/627#issuecomment-261222132, or mute
the thread
https://github.com/notifications/unsubscribe-auth/APKfrvl766fXAeQaHqkIDoFl8d0wORpoks5q_DhngaJpZM4K047u
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paulieo10 picture paulieo10  Â·  3Comments

jaydenseric picture jaydenseric  Â·  3Comments

AVVS picture AVVS  Â·  3Comments

natural-law picture natural-law  Â·  3Comments

knoxcard picture knoxcard  Â·  3Comments