2017-11-23 7 views
1

이온을 사용하고 있으며 machine1에서 git로 프로젝트를 가져 왔습니다. sudo npm install에서 액세스가 거부되었습니다.

내 이온 성 정보를 정기적으로

나에게주는이 :

[ERROR] Error with ./node_modules/@ionic/app-scripts/package.json file: FILE_NOT_FOUND

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils : 1.19.0 
ionic (Ionic CLI) : 3.19.0 

local packages:

@ionic/app-scripts : not installed 
Ionic Framework : ionic-angular 3.7.1 

System:

Node : v8.9.1 
npm : 5.5.1 
OS : macOS High Sierra 

Misc:

backend : pro 

내가 sudo npm install를 실행하면 나는 다음과 같은 얻을 : 나는 기본적으로 다음과 같은 솔루션 1과 3

을 시도

npm WARN checkPermissions Missing write access to /Users/gerald/Documents/ionic/yesterdayweather/node_modules npm WARN checkPermissions Missing write access to /Users/gerald/Documents/ionic/yesterdayweather/node_modules/@ionic

And then

gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/gerald/Documents/ionic/yesterdayweather/node_modules/node-sass/build' gyp ERR! System Darwin 17.2.0 gyp ERR! command "/usr/local/Cellar/node/8.9.1/bin/node" "/Users/gerald/Documents/ionic/yesterdayweather/node_modules/node-gyp/bin/nod e-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd /Users/gerald/Documents/ionic/yesterdayweather/node_modules/node-sass gyp ERR! node -v v8.9.1 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok Build failed with error code: 1 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] postinstall: node scripts/build.js npm ERR! Exit status 1

를 I 내가 노드를 pkg 방식으로 설치했다고 생각 했으므로 제거하고 양조로 intalled 했으므로 실제로이 문제가 없어야합니다.

하지만 어쨌든 옵션 1을 시도했지만 여전히 작동하지 않습니다.

아이디어가 있으십니까?

감사합니다.

+0

왜'sudo'로'npm install'을 실행합니까? –

+0

내가 sudo없이 실행하면 어딘가에 도착한다 : npm ERR! root/Administrator로이 명령을 다시 실행하십시오. – Krowar

답변

1

기본적으로 노드 gyp이 거부하는 파일을 외부 스크립트에서 작성하려고합니다. 명령 뒤에 --unsafe-perm을 넣어이 안전 가드를 비활성화 할 수 있습니다.

sudo를 사용하여 npm install을 실행하면 안됩니다. 왜냐하면 필요하지 않기 때문입니다. 전역 적으로 모듈을 설치하기 위해 -g 플래그를 사용할 때만 sudo를 사용해야합니다.

+0

도와 줘서 고마워하지만 작동하지 않았다. 같은 오류 – Krowar

+0

끊임없이 오류가 발생하는 동안이 문제에 대해 하루를 보냈다. "EACCES : permission denied, mkdir ..."및 많은 stackoverflow 게시물을보고이 문제가 해결되었습니다. . –

+0

@SarahMGiles 누군가 내 답을 찾은 것을 알게되어 기쁩니다! –