【问题标题】:How to fix node-gyp error with npm audit fix如何使用 npm audit fix 修复 node-gyp 错误
【发布时间】:2020-12-19 19:26:56
【问题描述】:

我在运行 npm audit fix 时遇到问题。
我想将 node.js 从 v0.10.32 更新到 v10。

环境

OS:CentOS release 6.10 (Final)
Node.js:v0.10.32

name        Current  Wanted  Latest  Location
config           1.2.1   1.2.1   3.2.5  NodeServer
forever         0.11.1  0.11.1   2.0.0  NodeServer
log4js          0.6.20  0.6.20   6.1.0  NodeServer
log4js-extend    0.1.2   0.1.2   0.2.1  NodeServer
opts             1.2.2   1.2.2   1.2.7  NodeServer
socket.io        1.3.6   1.3.6   2.3.0  NodeServer

这是我的错误信息

gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/root/.nvm/versions/node/v10.18.1/lib/node_modules/npm/node_modules/node-    gyp/lib/build.js:191: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 4.9.184-linuxkit
gyp ERR! command "/root/.nvm/versions/node/v10.18.1/bin/node" "/root/.nvm/versions/node/v10.18.1/lib/node_modules/np    m/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/www/html/testserver/node.js/node_modules/utf-8-validate
gyp ERR! node -v v10.18.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bufferutil@1.1.0 (node_modules/bufferutil):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: bufferutil@1.1.0 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: utf-8-validate@1.1.0 (node_modules/utf-8-validate):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: utf-8-validate@1.1.0 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
up to date in 2.31s
fixed 0 of 60 vulnerabilities in 503 scanned packages
  17 vulnerabilities required manual review and could not be updated
  3 package updates for 43 vulnerabilities involved breaking changes
  (use `npm audit fix --force` to install breaking changes; or refer to `npm audit` for steps to fix these manually)

我尝试删除 node_modules 目录和 npm install 但到目前为止没有发现任何有用的信息。
请帮我解决我的问题。之前谢谢你

【问题讨论】:

    标签: npm


    【解决方案1】:

    转到文件中的行号,即 root/.nvm/versions/node/v10.18.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js

    并评论该行。

    【讨论】:

      猜你喜欢
      • 2020-06-26
      • 2021-04-27
      • 2021-07-02
      • 2021-07-10
      • 2020-02-10
      • 2020-07-05
      • 2018-03-28
      • 1970-01-01
      • 2020-02-15
      相关资源
      最近更新 更多