Sharp: npm installation directory

Created on 12 May 2016  路  3Comments  路  Source: lovell/sharp

The npm install on wrong directory

sudo npm install sharp

> [email protected] install /home/pi/node_modules/sharp
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/6.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/pi/node_modules/sharp/.node-gyp"

should be /usr/local/lib/nod_modules/sharp/
and /usr/local/bin for node_modules/.bin

question

Most helpful comment

Thanks for your help
It's working fine with
sudo npm install --unsafe-perm -g sharp

All 3 comments

Bonjour, if you need to use sudo then you'll also need to add the --unsafe-perm flag to npm so it grants node-gyp the root-level access it will require - see https://github.com/nodejs/node-gyp/issues/454

Thanks for your help
It's working fine with
sudo npm install --unsafe-perm -g sharp

I am facing the same issue but in windows. How to resolve it?
what is the equivalent command for doing the same in windows

sudo npm install --unsafe-perm -g sharp

@emmtte @lovell
please help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AVVS picture AVVS  路  3Comments

vermin1337 picture vermin1337  路  3Comments

jaydenseric picture jaydenseric  路  3Comments

zhump picture zhump  路  3Comments

henbenla picture henbenla  路  3Comments