I tried installing on my local ubuntu machine and when that didn't work (thought it was my version of node/npm) I tried installing in a docker container:
$ docker pull node:16
$ cat c4builder.Dockerfile
FROM node:16
RUN npm i -g c4builder
$ docker build -t c4builder - < c4builder.Dockerfile
This fails:
npm WARN deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated topo@3.0.3: This module has moved and is now available at @hapi/topo. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated joi@14.3.1: This module has moved and is now available at @hapi/joi. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/c4builder/node_modules/node-plantuml
npm ERR! command failed
npm ERR! command sh -c node scripts/get-vizjs.js
npm ERR! node:events:498
npm ERR! throw er; // Unhandled 'error' event
npm ERR! ^
npm ERR!
npm ERR! Error: spawn java ENOENT
npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
npm ERR! at onErrorNT (node:internal/child_process:478:16)
npm ERR! at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! Emitted 'error' event on ChildProcess instance at:
npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
npm ERR! at onErrorNT (node:internal/child_process:478:16)
npm ERR! at processTicksAndRejections (node:internal/process/task_queues:83:21) {
npm ERR! errno: -2,
npm ERR! code: 'ENOENT',
npm ERR! syscall: 'spawn java',
npm ERR! path: 'java',
npm ERR! spawnargs: [
npm ERR! '-Dplantuml.include.path=/usr/local/lib/node_modules/c4builder/node_modules/node-plantuml',
npm ERR! '-Djava.awt.headless=true',
npm ERR! '-jar',
npm ERR! '/usr/local/lib/node_modules/c4builder/node_modules/node-plantuml/vendor/plantuml.jar',
npm ERR! '-testdot'
npm ERR! ]
npm ERR! }
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-02-28T22_11_43_780Z-debug-0.log
The command '/bin/sh -c npm i -g c4builder' returned a non-zero code: 1
I get the same error using node:alpine or node:17 as the FROM
I tried installing on my local ubuntu machine and when that didn't work (thought it was my version of node/npm) I tried installing in a docker container:
This fails:
I get the same error using
node:alpineornode:17as theFROM