본문 바로가기

Language & Framework/삽질기록

Nest.js 설치 시 Failed to execute command: npm install --silent 에러

 

결론은 제일 밑에 있으니 급한 사람은 밑에 보세요..

이건 제 일기장입니다.. 오랜만에 킹받아서 써봄.

 

 

 

간만에 자스로 뭔가 해볼 일이 생겨서 nest.js로 프로젝트를 생성하려고 하는데 아래와 같은 에러가 발생했다.

 

 

 

 

🙏🙏 이모티콘이 너무 킹받는다.

습관적으로 그대로 긁어서 구글에 검색했더니 KT 회선 문제라고.. 미러 서버 통해서 설치하면 된다고 한다.

 

스포 : 안 됨

 

 

 

에러 안 뜬다고 좋아했는데 15분이 지나도록 여기서 진행되질 않는다.

뭔가 잘못됐다.

그래서 레지스트리 세팅은 원상복구해놓고 스택오버플로우를 뒤져봤다.

 

 

 

 

https://stackoverflow.com/questions/57115017/nestjs-failed-to-execute-command-npm-install-silent

 

NestJs: Failed to execute command: npm install --silent

After I installed Nest globally, I tried creating a new project but I got this error Failed to execute command: npm install --silent. nest new new_project

stackoverflow.com

 

 

그럴듯해서 따라해봤다.

안 된다.

 

 

 

그래.. 날로 먹으려고 한 내가 잘못했다.

이럴 시간에 직접 확인했으면 이미 설치했을 것을 ^^..

 

 

npm install --verbose로 어디서 문제가 생겼는지 찾아보자.

 

0 verbose cli /usr/local/bin/node /usr/local/bin/npm 1 info using npm@10.6.0 2 info using node@v20.12.2 3 silly config:load:file:/usr/local/lib/node_modules/npm/npmrc 4 silly config:load:file:/Users/eunchanyang/Desktop/nest-js/nest-monorepo-proj-2/.npmrc 5 silly config:load:file:/Users/eunchanyang/.npmrc 6 silly config:load:file:/usr/local/etc/npmrc 7 verbose title npm install 8 verbose argv "install" "--loglevel" "silent" 9 verbose logfile logs-max:10 dir:/Users/eunchanyang/.npm/_logs/2024-04-29T14_28_13_120Z- 10 verbose logfile /Users/eunchanyang/.npm/_logs/2024-04-29T14_28_13_120Z-debug-0.log 11 silly logfile done cleaning log files 12 silly idealTree buildDeps 13 silly fetch manifest @nestjs/common@^10.0.0 14 verbose stack Error: EACCES: permission denied, open '/Users/eunchanyang/.npm/_cacache/tmp/f9978974' 15 verbose cwd /Users/eunchanyang/Desktop/nest-js/nest-monorepo-proj-2 16 verbose Darwin 23.2.0 17 verbose node v20.12.2 18 verbose npm v10.6.0 19 error code EACCES 20 error syscall open 21 error path /Users/eunchanyang/.npm/_cacache/tmp/f9978974 22 error errno -13 23 verbose Error: EACCES: permission denied, open '/Users/eunchanyang/.npm/_cacache/tmp/f9978974' 24 error 24 error Your cache folder contains root-owned files, due to a bug in 24 error previous versions of npm which has since been addressed. 24 error 24 error To permanently fix this problem, please run: 24 error sudo chown -R 501:20 "/Users/eunchanyang/.npm" 25 verbose exit -13 26 verbose code -13 27 silly unfinished npm timer command:install 1714400893237 28 silly unfinished npm timer reify 1714400893237 29 silly unfinished npm timer reify:loadTrees 1714400893239 30 silly unfinished npm timer idealTree 1714400893239 31 silly unfinished npm timer idealTree:buildDeps 1714400893247 32 silly unfinished npm timer idealTree:#root 1714400893247

 

 

어쩌고 저쩌고 쫑알쫑알 써있는데.

 

"error Your cache folder contains root-owned files, due to a bug in 24 error previous versions of npm which has since been addressed. "

"error To permanently fix this problem, please run: 24 error sudo chown -R 501:20 "/Users/eunchanyang/.npm"

 

내 npm 캐시 폴더의 파일이 일부 루트 권한으로 설정되어 있다고 한다.

심지어 명령어도 친절하게 알려준다.

이렇게 친절한 친구를 두고 나는 구글링이나 하고 있었다.

 

gpt 덕분에 점점 지능이 퇴화되는 것 같다.

 

 

설치 10초 컷.

끝.