2017-09-20 4 views
0

Wenn ich ein frisches npm Projekt:Fehler bei der Installation scharf mit npm auf macOS

mkdir ~/test 
cd ~/test 
npm init -y 

Und dann versuchen sharp zu installieren:

npm install --save sharp 

bekomme ich folgende Fehlermeldungen:

> [email protected] install /Users/hsribei/tmp/test/node_modules/sharp 
> node-gyp rebuild 

sh: /usr/local/lib/node_modules/npm/bin/node-gyp-bin/node-gyp: Permission denied 
npm WARN [email protected] No description 
npm WARN [email protected] No repository field. 

npm ERR! code ELIFECYCLE 
npm ERR! errno 126 
npm ERR! [email protected] install: `node-gyp rebuild` 
npm ERR! Exit status 126 
npm ERR! 
npm ERR! Failed at the [email protected] 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!  /Users/hsribei/.npm/_logs/2017-09-20T19_11_03_836Z-debug.log 

Ich habe Anweisungen gefunden zu löschen ~/.node-gyp, versuchte das, hat nicht funktioniert. Löschen node_modules und erneut versuchen funktioniert auch nicht. Das Laufen als sudo hilft auch nicht.

Irgendwelche Ideen in, wie ich verfolgen kann, was das Problem ist?

Antwort

1

Ich fand heraus, es gibt eine fehlende globale Abhängigkeit für sharp.

Wenn Sie

npm install -g node-gyp 

erste, dann

npm install --save sharp 

Es funktioniert laufen.

Verwandte Themen