npm或纱线,`node gyp rebuild`npm ERR!退出状态1

npm或纱线,`node gyp rebuild`npm ERR!退出状态1,npm,node-modules,yarnpkg,Npm,Node Modules,Yarnpkg,我在windows中使用Thread,我尝试过:12.13.1、*10.16.0(目前使用64位可执行文件)、9.11.2,我遇到以下错误: error C:\XXX\node_modules\node-expat: Command failed. Exit code: 1 Command: node-gyp rebuild Arguments: Directory: C:\XXX\node_modules\node-expat Output: C:\XXX\node_modules\node-

我在windows中使用Thread,我尝试过:12.13.1、*10.16.0(目前使用64位可执行文件)、9.11.2,我遇到以下错误:

error C:\XXX\node_modules\node-expat: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\XXX\node_modules\node-expat
Output:
C:\XXX\node_modules\node-expat>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.16.0 | win32 | x64
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Program Files (x86)\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: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.18362
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:\XXX\node_modules\node-expat
生成进程正在尝试使用python3(应该是
print(“…”)
)运行python2代码(例如,
print“…”)

您可以尝试安装python2(但从2020年1月起不再受支持),并强制安装过程运行python2

或者,您可以尝试更新本地python安装并重试

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-expat@2.3.18 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-expat@2.3.18 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\paulo.miranda\AppData\Roaming\npm-cache\_logs\2020-04-02T12_32_03_383Z-debug.log
 C:\Program Files (x86)\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];