gpt4 book ai didi

node.js - Node-Red gyp 安装失败

转载 作者:行者123 更新时间:2023-12-04 19:26:37 25 4
gpt4 key购买 nike

我在运行 Ubuntu Ubuntu 20.04.3 LTS 和 nodejs v14.18.2 的虚拟机上使用 Node-Red
我正在尝试安装 Node 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,
费德里科

最佳答案

错误是因为 gyp 找不到命令 make这是构建支持 java 的 native 组件所必需的 Node 是 node-red-contrib-as400 的依赖项.
最快的解决方法可能是运行以下命令:

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

关于node.js - Node-Red gyp 安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70248779/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com