简介:前言今天安装opensumi时报错:报错信息:npm config set -g msvs_version 2019...
!!!opensumi 安装报错:node-pty: Command failed. 参考此方式:https://github.com/nodejs/node/issues/52554
前言
今天安装opensumi时报错:
报错信息:Exit code: 1
Command: node scripts/install.js
Arguments:
Directory: E:\work\ART\src\front\ide-startup-lite-main\node_modules\node-pty
Output:
node:internal/child_process:414
throw errnoException(err, 'spawn');
^
Error: spawn EINVAL
at ChildProcess.spawn (node:internal/child_process:414:11)
at spawn (node:child_process:761:9)
at Object.<anonymous> (E:\work\ART\src\front\ide-startup-lite-main\node_modules\node-pty\scripts\install.js:11:20)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Module._load (node:internal/modules/cjs/loader:1019:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Module._load (node:internal/modules/cjs/loader:1019:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
at node:internal/main/run_main_module:28:49 {
errno: -4071,
code: 'EINVAL',
解决办法
安装python3 安装 vs2019
https://opensumi.com/zh/docs/develop/how-to-contribute#%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87
降级npm
npm install -g npm@^8
设置python和vs路径
npm config set -g msvs_version 2019
npm config set -g python "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.13_3.13.1008.0_x64__qbz5n2kfra8p0\python.exe"
重新安装
其他
还有一种解决是:https://github.com/nodejs/node/issues/52554
猜测改代码,但是代码又不是我写的 所以放弃了,最后降级了