我在运行Ubuntu Ubuntu 20.04.3 LTS和nodejs v14.18.2的虚拟机上使用Node
我正在尝试安装节点节点-红色-控制-as400 400,但是我得到了以下错误:
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 ]提前感谢您的帮助!
费德里科
发布于 2021-12-06 18:03:31
这个错误是因为gyp找不到命令make,这是构建支持java节点的本地组件所需的,后者是node-red-contrib-as400的依赖项。
解决这一问题的最快方法可能是运行以下程序:
sudo apt-get update
sudo apt-get install build-essentialhttps://stackoverflow.com/questions/70248779
复制相似问题