首页 > 解决方案 > npm install 失败并出现 python 模块错误

问题描述

我正在尝试安装和运行我从互联网上购买的 react 项目。但是,我运行 npm install 我收到以下错误

gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /home/AzureUser/Python3/python
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /home/AzureUser/Python3/python -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 Linux 4.18.0-193.6.3.el8_2.x86_64
gyp ERR! command "/usr/bin/node" "/var/tmp/thermo-api/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /var/tmp/thermo-api/node_modules/node-sass
gyp ERR! node -v v10.21.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

我对 node.js 很陌生,我不确定出了什么问题?

标签: node.js

解决方案


推荐阅读