-
VS CODE에서 npm install 시 EACCESS 권한 오류 발생설치&설정 관련 2020. 6. 30. 22:42728x90
VS CODE에서 NPM 사용시 권한 문제 해결
Windows 10에서 Windows Subsystem for Linux(WSL)를 설치 후 node의 개발을 VSCODE를 이용해서 진행하려고 하였습니다.
문제의 발생은 VSCODE의 terminal에서 npm을 이용해서 모듈을 설치할때 발생하였습니다.
# IN VS CODE TERMINAL $> cd /project $> npm i npm ERR! code EACCES npm ERR! syscall rename npm ERR! path /project/node_modules/@samverschueren/stream-to-observable npm ERR! dest /project/node_modules/@samverschueren/.stream-to-observable.DELETE npm ERR! errno -13
sudo 명령어를 이용해서 시도해보고, root 권한으로도 시도 해보았으나, 동일한 오류가 발생했습니다.
하지만, wsl 터미널에서는 해당 문제가 없이 설치가 진행됩니다.
npm install 명령어는 자주 사용하기에 해결 방법을 찾아보니, Developing in WSL에서 다음과 같은 내용을 찾았습니다.
I see EACCESS: permission denied error trying to rename a folder in the open workspace
That's a known problem with the WSL file system implementation (Microsoft/WSL#3395, Microsoft/WSL#1956) caused by the file watcher active by VSCode. The issue will only be fixed in WSL 2.To avoid the issue, set remote.WSL.fileWatcher.polling to true. However, polling based has a performance impact for large workspaces.
For large workspace you want to increase the polling interval: remote.WSL.fileWatcher.pollingInterval and control the folders that are watched: files.watcherExclude.
WSL 2 does not have that file watcher problem is also not affected by the new setting.
해당 이슈는 WSL 2에서 해결된다고 합니다.
우선 간단하게 해당 문제를 피하기 위해서는 vscode에서 설정으로 가서 remote.WSL.fileWatcher.polling 옵션을 true로 체크 해주면 됩니다.
다른 이슈도 Developing in WSL에 잘 정리되어 있습니다.
참고 자료
728x90'설치&설정 관련' 카테고리의 다른 글
Windows WSL에서 GUI 사용하기 (0) 2020.07.02 보안프로그램을 피해서 WSL 설치하기! (0) 2020.07.01 특정 도메인의 API를 사용시 발생하는 ssl certificate_verify_failed 오류 (0) 2020.06.29 windows에 wsl 설치하고 설정하기 (0) 2020.06.28 Kubernetes Persistent Volumes 사용하기 (0) 2020.06.27