質問: npminstallの実行時のnode-gypエラー npminstallの実行中にエラーが発生しましたc:\cygwin64\home\kjeeva\ansysdev\licensing194\licensingportal\node_modules\strong-ursa>if not defined npm_config_node_gyp (node "c:\program files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "c:\program files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) gyp err! configure error gyp err! stack error: command failed: c:\users\kjeeva\appdata\local\programs\python\python37-32\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:189:13) gyp err! stack at maybeclose (internal/child_process.js:970:16) gyp err! stack at process.childprocess._handle.onexit (internal/child_process.js:259:5) gyp err! system windows_nt 10.0.17763 gyp err! command "c:\\program files\\nodejs\\node.exe" "c:\\program files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp err! cwd c:\cygwin64\home\kjeeva\ansysdev\licensing194\licensingportal\node_modules\strong-ursa gyp err! node -v v10.15.3 gyp err! node-gyp -v v3.8.0 gyp err! not ok
回答: node-gypはpython 2を必要とするようです。最初にpython 2をダウンロードし、次にノードが使用するpythonのバージョンを次のように設定します:npm config set python /usr/bin/python2.7 詳細: https://github.com/nodejs/node-gyp/issues/1651