npm install -g 에러

박형석·2022년 4월 1일
0

트러블슈팅

목록 보기
1/1

Could not install from "" as it does not contain a package.json file.

npm ERR! code ENOLOCAL
npm ERR! Could not install from "" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-04-01T13_27_59_845Z-debug.log

이러한 오류가 발생하는 이유는 로컬 사용자의 폴더 이름에 공백이 있어서 발생한 것 일수도 있다.

그래서 해결방법은 (윈도우나 리눅스나 똑같다.)

우선 node, npm, npx가 잘 설치되어 있는지 --version으로 확인 해보고, 잘 설치되어 있으면

npm config set cache C:\tmp\nodejs\npm-cache --global을 입력해 준다.

만약, permission denide가 뜬다면 sudo를 붙여주자.

profile
Better Than Yesterday

0개의 댓글