2017-12-26 44 views
0

webpackreact 애플리케이션의 로더로 사용하고 있습니다. node-sass은 내가 사용하는 적재기 중 하나입니다. 내 운영 체제는 Mac OSX High Sierra입니다. 현재 node v8.9.3을 (를) 사용하고 있습니다. npm을 사용하여 설치할 수는 없지만 yarn을 사용할 수 있습니다. 나는 내가 node-sass 패키지를 제거 npm 사용하여 내 프로젝트를 업데이트 할 경우 yarn를 사용하여 node-sass를 설치내 반응 프로젝트에서 npm을 사용하여 node-sass를 추가 할 수 없습니다. 내 Mac에서 개발 중입니다.

Unable to save binary /Users/user/Documents/react/react.js-essential-training/node_modules/node-sass/vendor/darwin-x64-57 : { Error: 
EACCES: permission denied, mkdir '/Users/user/Documents/react/react.js-essential-training/node_modules/node-sass/vendor' 
at Object.fs.mkdirSync (fs.js:885:18) 
at sync (/Users/user/Documents/react/react.js-essential-training/node_modules/mkdirp/index.js:71:13) 
at Function.sync (/Users/user/Documents/react/react.js-essential-training/node_modules/mkdirp/index.js:77:24) 
at checkAndDownloadBinary (/Users/user/Documents/react/react.js-essential-training/node_modules/node-sass/scripts/install.js:111 
:11) 
at Object.<anonymous> (/Users/user/Documents/react/react.js-essential-training/node_modules/node-sass/scripts/install.js:154:1) 
at Module._compile (module.js:635:30) 
at Object.Module._extensions..js (module.js:646:10) 
at Module.load (module.js:554:32) 
at tryModuleLoad (module.js:497:12) 
at Function.Module._load (module.js:489:3) 
errno: -13, 
code: 'EACCES', 
syscall: 'mkdir', 
path: '/Users/user/Documents/react/react.js-essential-training/node_modules/node-sass/vendor' } 

> [email protected] postinstall /Users/user/Documents/react/react.js-essential-training/node_modules/node-sass 
> node scripts/build.js 

Building: /Users/user/.nvm/versions/node/v8.9.3/bin/node /Users/user/Documents/react/react.js-essential-training/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library= 
gyp info it worked if it ends with ok 
gyp verb cli [ '/Users/user/.nvm/versions/node/v8.9.3/bin/node', 
gyp verb cli '/Users/user/Documents/react/react.js-essential-training/node_modules/node-gyp/bin/node-gyp.js', 
gyp verb cli 'rebuild', 
gyp verb cli '--verbose', 
gyp verb cli '--libsass_ext=', 
gyp verb cli '--libsass_cflags=', 
gyp verb cli '--libsass_ldflags=', 
gyp verb cli '--libsass_library=' ] 
gyp info using [email protected] 
gyp info using [email protected] | darwin | x64 
gyp verb command rebuild [] 
gyp verb command clean [] 
gyp verb clean removing "build" directory 
gyp verb command configure [] 
gyp verb check python checking for Python executable "python2" in the PATH 
gyp verb `which` failed Error: not found: python2 
gyp verb `which` failed  at getNotFoundError (/Users/user/Documents/react/react.js-essential-training/node_modules/which/which.js:13:12) 
gyp verb `which` failed  at F (/Users/user/Documents/react/react.js-essential-training/node_modules/which/which.js:68:19) 
gyp verb `which` failed  at E (/Users/user/Documents/react/react.js-essential-training/node_modules/which/which.js:80:29) 
gyp verb `which` failed  at /Users/user/Documents/react/react.js-essential-training/node_modules/which/which.js:89:16 
gyp verb `which` failed  at /Users/user/Documents/react/react.js-essential-training/node_modules/isexe/index.js:42:5 
gyp verb `which` failed  at /Users/user/Documents/react/react.js-essential-training/node_modules/isexe/mode.js:8:5 
gyp verb `which` failed  at FSReqWrap.oncomplete (fs.js:152:21) 
gyp verb `which` failed python2 { Error: not found: python2 
gyp verb `which` failed  at getNotFoundError (/Users/user/Documents/react/react.js-essential-training/node_modules/which/which.js:13:12) 
gyp verb `which` failed  at F (/Users/user/Documents/react/react.js-essential-training/node_modules/which/which.js:68:19) 
gyp verb `which` failed  at E (/Users/user/Documents/react/react.js-essential-training/node_modules/which/which.js:80:29) 
gyp verb `which` failed  at /Users/user/Documents/react/react.js-essential-training/node_modules/which/which.js:89:16 
gyp verb `which` failed  at /Users/user/Documents/react/react.js-essential-training/node_modules/isexe/index.js:42:5 
gyp verb `which` failed  at /Users/user/Documents/react/react.js-essential-training/node_modules/isexe/mode.js:8:5 
gyp verb `which` failed  at FSReqWrap.oncomplete (fs.js:152:21) 
gyp verb `which` failed stack: 'Error: not found: python2\n at getNotFoundError (/Users/user/Documents/react/react.js-essential-training/node_modules/which/which.js:13:12)\n at F (/Users/user/Documents/react/react.js-essential-training/node_modules/which/which.js:68:19)\n at E (/Users/user/Documents/react/react.js-essential-training/node_modules/which/which.js:80:29)\n at /Users/user/Documents/react/react.js-essential-training/node_modules/which/which.js:89:16\n at /Users/user/Documents/react/react.js-essential-training/node_modules/isexe/index.js:42:5\n at /Users/user/Documents/react/react.js-essential-training/node_modules/isexe/mode.js:8:5\n at FSReqWrap.oncomplete (fs.js:152:21)', 
gyp verb `which` failed code: 'ENOENT' } 
gyp verb check python checking for Python executable "python" in the PATH 
gyp verb `which` succeeded python /usr/bin/python 
gyp verb check python version `/usr/bin/python -c "import platform; print(platform.python_version());"` returned: "2.7.10\n" 
gyp verb get node dir no --target version specified, falling back to host node version: 8.9.3 
gyp verb command install [ '8.9.3' ] 
gyp verb install input version string "8.9.3" 
gyp verb install installing version: 8.9.3 
gyp verb install --ensure was passed, so won't reinstall if already installed 
gyp verb install version is already installed, need to check "installVersion" 
gyp verb got "installVersion" 9 
gyp verb needs "installVersion" 9 
gyp verb install version is good 
gyp verb get node dir target node version installed: 8.9.3 
gyp verb build dir attempting to create "build" dir: /Users/user/Documents/react/react.js-essential-training/node_modules/node-sass/build 
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/user/Documents/react/react.js-essential-training/node_modules/node-sass/build' 
gyp ERR! System Darwin 17.3.0 
gyp ERR! command "/Users/user/.nvm/versions/node/v8.9.3/bin/node" "/Users/user/Documents/react/react.js-essential-training/node_modules/node- 
gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" 
gyp ERR! cwd /Users/user/Documents/react/react.js-essential-training/node_modules/node-sass 
gyp ERR! node -v v8.9.3 
gyp ERR! node-gyp -v v3.6.2 
gyp ERR! not ok 
Build failed with error code: 1 
npm WARN [email protected] No repository field. 

npm ERR! code ELIFECYCLE 
npm ERR! errno 1 
npm ERR! [email protected] postinstall: `node scripts/build.js` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] postinstall 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/user/.npm/_logs/2017-12-26T06_42_24_432Z-debug.log 

이 중요한 이유 때문에 후 : 내가 npm를 사용할 때 다음의 결과입니다.

+0

'sudo' 명령으로 시도 했습니까 ?? – Subburaj

+0

@Subburaj 예 sudo를 사용했습니다 –

+0

폴더에 쓰기 권한이 있는지 여부 ??? – Subburaj

답변

1

때때로 노드 말대꾸의 바이너리를 설치하는 문제가 있고 당신은 당신의 아키텍처를 재 구축 할 필요가있다. 그러나, 나는 패키지의 캐시를 청소하여 고정되어 자동적으로 그런 오류를 보이고있는 것은 : 오류 경우

npm cache clean 

또는

yarn cache clean 

이 명령을 실행 한 후, 다시 종속성을 설치하려고 노드 말대꾸 패키지의 건물을 강제로 시도가 지속

npm rebuild node-sass --force 

또는

yarn install node-sass --force