오류

2017-09-20 7 views
0

나는 신선한 NPM 프로젝트 작성하는 경우 :오류

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

그리고이 sharp를 설치하려고 :

npm install --save sharp 

를 내가받을 다음과 같은 오류 메시지가 :

> [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 

~/.node-gyp을 삭제하라는 안내를 찾았습니다. 작동하지 않았습니다. node_modules을 삭제하고 다시 시도해도 작동하지 않습니다. sudo으로 실행해도 도움이되지 않습니다.

문제가 무엇인지 추적 할 수있는 아이디어가 있습니까?

답변

1

sharp에 대한 전역 종속성이 누락되었습니다.

먼저

npm install -g node-gyp 

는 다음

npm install --save sharp 

의미가 있습니다 실행하는 경우.