首页 > 解决方案 > npm:npm 错误!在 node-pty@0.6.10 安装脚本中失败。安装 Node OS 和 node-gyp 时

问题描述

我正在尝试创建一个 Node OS 发行版,在安装其命令行依赖项后,运行“npm install”会导致以下错误。

gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/share/nodejs/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 5.4.72-microsoft-standard-WSL2
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/vinny/NodeOS/node_modules/node-pty
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-pty@0.6.10 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-pty@0.6.10 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!     /root/.npm/_logs/2021-02-26T23_32_45_386Z-debug.log

如您所知,我正在运行 WSL,并且安装了 VcXsrv 并且工作正常,所以不用担心。

但是如何成功安装 node-gyp?提前致谢!

标签: node.jsnpm

解决方案


推荐阅读