프론트기술/Angular

check python checking for Python executable "python" in the PATH

RevFactory 2021. 2. 20. 22:09

윈도우 환경에서 Angular Project에서 npm 명령을 수행할때, 아래와 같은 에러가 발생했다.

gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Users\revfactory\AppData\Local\Programs\Python\Python39\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\revfactory\AppData\Local\Programs\Python\Python39\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                       ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:308:12)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

 

 

이 경우 powershell을 관리자 권한으로 열고 아래 명령을 통해 빌드 툴을 설치해줘야 한다.

npm install --global --production windows-build-tools