【发布时间】:2020-07-14 11:07:07
【问题描述】:
我在 windows 中使用 yarn,我尝试过: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
不要理解消息。我可以看到 node_modules 文件夹已创建,但这发生在整个过程的“链接”步骤结束时。使用 npm 也会发生同样的情况。
我一直在尝试: - 使用纱线或 npm - 删除锁定文件 - 删除 node_modules 文件夹
总是同样的错误。有什么想法吗?
使用 npm 我得到了这个消息:
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
【问题讨论】:
标签: npm node-modules yarnpkg