본문 바로가기

개발/오류

npm install시 -4048 에러 (operation not permitted, unlink ~)

 

모듈 정리가 싹 된걸 깃풀 받아서 npm install 했더니 아래와 같이 에러가 났다

 

error code EPERM
error syscall unlink
error path C:\###\###\node_modules\.staging\typescript-93036de9\lib\tsserver.js
error errno -4048
error Error: EPERM: operation not permitted, unlink 'C:\###\###\node_modules\.staging\typescript-93036de9\lib\tsserver.js'
error  [OperationalError: EPERM: operation not permitted, unlink 'C:\###\###\node_modules\.staging\typescript-93036de9\lib\tsserver.js'] {
error   cause: [Error: EPERM: operation not permitted, unlink 'C:\###\###\node_modules\.staging\typescript-93036de9\lib\tsserver.js'] {
error     errno: -4048,
error     code: 'EPERM',
error     syscall: 'unlink',
error     path: 'C:\\###\\###\\node_modules\\.staging\\typescript-93036de9\\lib\\tsserver.js'
error   },
error   stack: "Error: EPERM: operation not permitted, unlink 'C:\\###\\###\\node_modules\\.staging\\typescript-93036de9\\lib\\tsserver.js'",
error   errno: -4048,
error   code: 'EPERM',
error   syscall: 'unlink',
error   path: 'C:\\###\\###\\node_modules\\.staging\\typescript-93036de9\\lib\\tsserver.js',
error   parent: '###'
error }
error The operation was rejected by your operating system.
error It's possible that the file was already in use (by a text editor or antivirus),
error or that you lack permissions to access it.
error
error If you believe this might be a permissions issue, please double-check the
error permissions of the file and its containing directories, or try running
error the command again as root/Administrator.

 

개발자방에 물어봐도 이렇게 오류난 사람이 없는걸 보니 또 윈도우에서만 오류가 난거였다. (윈또...)

 

1. 선조들의 지혜의 정수 깃헙 이슈 참고하기

https://github.com/npm/npm/issues/16861

 

npm ERR! code EINTEGRITY (npm 5) · Issue #16861 · npm/npm

I'm opening this issue because: npm is doing something I don't understand. What's going wrong? I deleted the node_modules and ran npm install, it won't finish installing. It throws ...

github.com

 

여기에 같은 오류 난 사람들이 이것저것 해본 흔적들이 있는데

해결됐다는 사람들이 많으니 여기있는거 먼저 시도해보는걸 추천한다.

 

 

나는 뻥안치고 여기있는거 90%는 해봤는데 다 안됐다!!^^

(10%는 딱봐도 나한테 해당없어 보이는거)

 

 

2. ✨npm 다 날려버리고 최신버전으로 새로 설치✨

장장 5시간 삽질끝에 드디어 해결해낸 방법이다.

 

대체 왜 그런건지 이유는 아직도 모른다.. 아무튼 윈도우가 잘못한걸로..

 

 

 

 

 


(+)

npm 새로 설치할때 node까지 다시 설치했더니 nvm이 노드 버전을 변경안해주는 오류가 발생했다.

당황하지 말고 nvm을 새로 설치해주자. (프로그램 설치제거 -> nvm 제거 -> nvm 다시 설치)

 

설치과정은 아래 링크 참조

 

https://the-amy.tistory.com/3

 

node 버전을 바꿔가며 개발하고 싶을때는 nvm 설치 (Windows)

프로젝트 별로 노드버전을 다르게 해서 개발해야하는 경우가 있다. 그럴때는 nvm을 이용하면 편하게 노드 버전을 변경할 수 있다. 1. nvm 설치 (windows) https://github.com/coreybutler/nvm-windows/releases 2...

the-amy.tistory.com