-
[Jenkins] Jenkins에서 React 빌드 에러: gyp verb check python checking for Python executable "python" in the PATHCICD 2022. 2. 10. 15:04
Jenkins로 리액트 프로젝트를 빌드 하는데 다음과 같은 오류가 발생하였다.
gyp verb check python checking for Python executable "python2" in the PATH gyp verb `which` failed Error: not found: python2 gyp verb check python checking for Python executable "python" in the PATH gyp verb `which` failed Error: not found: python
python과 python2.7 을 모두 설치 해 준 후에는 다음과 같은 에러가 발생 하였다.
gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/var/jenkins_home/workspace/WEBTOB_WAPL_BUILD/node_modules/node-sass/node_modules/node-gyp/lib/build.js:262:23) gyp ERR! stack at ChildProcess.emit (node:events:520:28) gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) gyp ERR! System Linux 5.11.0-25-generic gyp ERR! command "/usr/bin/node" "/var/jenkins_home/workspace/WEBTOB_WAPL_BUILD/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd /var/jenkins_home/workspace/WEBTOB_WAPL_BUILD/node_modules/node-sass gyp ERR! node -v v16.14.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok
node-sass를 재설치 하기도 하고 여러가지 방법을 써봤지만 해결 되지 않았다.
Nodejs 버전 확인
$ node -v
최근에 Jenkins를 재설치 하고 Nodejs를 설치 하였는데 자동으로 Nodejs 16 LTS 가 설치 되었다.
Nodejs의 버전을 관리해 주는 플러그인을 설치하고 Nodejs의 버전을 14 LTS로 다운그레이드 해주었다.
Node 버전 관리 플러그인 n 설치
npm install -g n
Node 버전 변경
n 14.19.0
그 후 React 프로젝트를 빌드하니 정상적으로 빌드가 되었다.
'CICD' 카테고리의 다른 글