3

I'm getting below error - gyp ERR! stack Error: Command failed: when executing npm install in a project. Can you help me in resolving this error please?

gyp verb check python checking for Python executable "C:\Users\...\AppData\Local\Programs\Python\Python37\python.exe" in the PATH
gyp verb `which` succeeded C:\Users\...\AppData\Local\Programs\Python\Python37\python.exe C:\Users\...\AppData\Local\Programs\Python\Python37\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\...\AppData\Local\Programs\Python\Python37\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:294:12)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\project\\...\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\project\...\node_modules\node-sass
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
V.Vidyasagar
  • 633
  • 6
  • 13
  • 1
    Might want to try this [link](https://stackoverflow.com/questions/54059433/after-npm-install-an-error-about-a-syntax-error-in-python-appears)? – Sentinel Jul 26 '19 at 09:57
  • @Sentinel Thanks for the link and it helped. Actually this error got resolved after installing Python 2 (exact version - 2.7.15) and pointing the environment variable PYTHON to C:\Python27\python.exe. Now i'm encountering another error that i'm try to resolve :) – V.Vidyasagar Jul 26 '19 at 11:09
  • Very good. Glad to have been able to help :) – Sentinel Jul 26 '19 at 14:13

0 Answers0