【问题标题】:Node-Red gyp installation failsNode-Red gyp 安装失败
【发布时间】:2021-12-06 16:35:31
【问题描述】:

我在运行 Ubuntu Ubuntu 20.04.3 LTS 和 nodejs v14.18.2 的虚拟机上使用 Node-Red

我正在尝试安装节点 node-red-contrib-as400,但出现以下错误:

6 Dec 16:24:44 - [info] Installing module: node-red-contrib-as400, version: 0.0.2
6 Dec 16:24:46 - [warn] Installation of module node-red-contrib-as400 failed:
6 Dec 16:24:46 - [warn] ------------------------------------------
6 Dec 16:24:46 - [warn] gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack     at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack     at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:191:21)
gyp ERR! System Linux 5.4.0-91-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/tecnico/.node-red/node_modules/java
gyp ERR! node -v v14.18.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! java@0.9.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the java@0.9.1 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!     /home/tecnico/.npm/_logs/2021-12-06T16_24_46_847Z-debug.log
6 Dec 16:24:46 - [warn] ------------------------------------------
Error: Install failed
    at /usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/installer.js:285:25
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
6 Dec 16:24:46 - [error] Error: Install failed

有没有办法解决这个错误?

编辑:

我遵循了@hardillb 提供的建议,这是错误输出:

533 warn enoent ENOENT: no such file or directory, open '/home/tecnico/package.json'
534 verbose enoent This is related to npm not being able to find a file.
535 warn tecnico No description
536 warn tecnico No repository field.
537 warn tecnico No README data
538 warn tecnico No license field.
539 verbose stack Error: java@0.9.1 install: `node-gyp rebuild`
539 verbose stack Exit status 1
539 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
539 verbose stack     at EventEmitter.emit (events.js:400:28)
539 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
539 verbose stack     at ChildProcess.emit (events.js:400:28)
539 verbose stack     at maybeClose (internal/child_process.js:1058:16)
539 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
540 verbose pkgid java@0.9.1
541 verbose cwd /home/tecnico
542 verbose Linux 5.4.0-91-generic
543 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "node-red-contrib-as400"
544 verbose node v14.18.2
545 verbose npm  v6.14.15
546 error code ELIFECYCLE
547 error errno 1
548 error java@0.9.1 install: `node-gyp rebuild`
548 error Exit status 1
549 error Failed at the java@0.9.1 install script.
549 error This is probably not a problem with npm. There is likely additional logging output above.
550 verbose exit [ 1, true ]

提前感谢您的帮助!

BR, 费德里科

【问题讨论】:

    标签: node.js ubuntu node-red


    【解决方案1】:

    错误是因为 gyp 找不到命令 make,这是构建支持 java 节点的本机组件所需的命令,该节点是 node-red-contrib-as400 的依赖项。

    最快的解决方法可能是运行以下命令:

    sudo apt-get update
    sudo apt-get install build-essential
    

    【讨论】:

    • 嗨@hardillb,我听从了你的建议,但我收到另一个错误,我在我的问题中报告为编辑。谢谢你的帮助! BR
    • @Federico 新问题 -> 新问题
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-27
    • 2018-05-19
    • 2020-03-19
    • 1970-01-01
    • 2023-04-09
    相关资源
    最近更新 更多