Javascript & HTML & CSS/Javascript
[NPM] error can't find python executable python you can set the python env variable mac 오류해결
전봉근
2022. 4. 18. 18:12
반응형
NPM install 시에 "error can't find python executable python you can set the python env variable mac" 오류 해결 (node-pre-gyp 설치시 기준)
python 경로를 못찾거나 버전이슈일 가능성이 높다. 현재 진행한 환경은 Mac의 Python3 이며 Python2를 설치하여 환경변수를 변경하여 해결하였다.
// homebrew를 통한 python 2.7.18 설치
$ brew install pyenv
$ pyenv install 2.7.18
// 환경변수 등록 (위의 파이썬 설치후에 표시되는 경로를 하기 npm_config_python= 에 넣고 명령실행)
$ export npm_config_python=Users/bkjeon/.pyenv/versions/2.7.18/bin/python2
반응형