Upating Admin Console Docs

I came across an issue when doing npm install with the ziti console it needs to be updated to node v18.13.0 and .
Below I will paste the error.

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'io.netfoundry.zac@2.9.2',
npm WARN EBADENGINE required: { node: '>=18.13.0' },
npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@apidevtools/json-schema-ref-parser@10.0.1',
npm WARN EBADENGINE required: { node: '>= 17' },
npm WARN EBADENGINE current: { node: 'v16.20.2', npm: '8.19.4' }
npm WARN EBADENGINE }
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /ziti-console/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/ziti-console/node_modules'
npm ERR! [Error: EACCES: permission denied, mkdir '/ziti-console/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/ziti-console/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/tech/.npm/_logs/2023-09-28T00_53_21_423Z-debug-0.log

Here is what I did to get it working.

tech@tech-HP-Z620-Workstation:/ziti-console$ nvm install 18.13.0
Downloading and installing node v18.13.0...
Downloading https://nodejs.org/dist/v18.13.0/node-v18.13.0-linux-x64.tar.xz...
######################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v18.13.0 (npm v8.19.3)
tech@tech-HP-Z620-Workstation:/ziti-console$ npm install
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /ziti-console/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/ziti-console/node_modules'
npm ERR! [Error: EACCES: permission denied, mkdir '/ziti-console/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/ziti-console/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/tech/.npm/_logs/2023-09-28T01_01_07_304Z-debug-0.log
tech@tech-HP-Z620-Workstation:/ziti-console$ sudo chown -R $(whoami) /ziti-console
tech@tech-HP-Z620-Workstation:/ziti-console$ sudo chmod -R 775 /ziti-console
tech@tech-HP-Z620-Workstation:/ziti-console$ sudo npm install
sudo: npm: command not found
tech@tech-HP-Z620-Workstation:/ziti-console$ sudo npm install
sudo: npm: command not found
tech@tech-HP-Z620-Workstation:/ziti-console$ npm install
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See There’s Math.random(), and then there’s Math.random() · V8 for details.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

added 205 packages, and audited 454 packages in 11s

37 packages are looking for funding
run npm fund for details

2 moderate severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

Run npm audit for details.
npm notice
npm notice New major version of npm available! 8.19.3 -> 10.1.0
npm notice Changelog: Release v10.1.0 · npm/cli · GitHub
npm notice Run npm install -g npm@10.1.0 to update!
npm notice
tech@tech-HP-Z620-Workstation:/ziti-console$ npm install -g npm@10.1.0
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: npm@10.1.0
npm ERR! notsup Not compatible with your version of node/npm: npm@10.1.0
npm ERR! notsup Required: {"node":"^18.17.0 || >=20.5.0"}
npm ERR! notsup Actual: {"npm":"8.19.3","node":"v18.13.0"}

npm ERR! A complete log of this run can be found in:
npm ERR! /home/tech/.npm/_logs/2023-09-28T01_03_16_510Z-debug-0.log

Let me know if I fudged it up like a dummy. Haha. I can take the feedback.

Hi @mcardoza1, welcome to the community and to OpenZiti!

Yes, indeed the version of node needs to be 16+. It's captured in the doc at: Ziti Admin Console | OpenZiti

You shouldn't need 18, but that's usually what gets installed now-a-days.

That cover what you're seeing?

Like I said I probably fudged it but when I performed an npm install from the ziti console directory.
The I got the errors requiring nodejs -v17 instead of 16 which I thought was weird because I install the ZAC before when testing for Cloud Underground. Maybe when you guys did updates to the ZAC it now needs 17 and above? Again I can be wrong. I've been wrong before and I don't mind being wrong again. According to the docs yes nodejs 16 I agree complete, maybe my version of ubuntu is weird. I'm using Ubuntu 22 jammy

Oh, I thought you were just pointing out that 16+ was needed. I misunderstood.

Looking through the output. I see:

npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user

I think you just need to use sudo here. Running it as a service I think makes a file or two by root.

I'll give it a shot and see if the default instructions still work at least for me... Gimme a sec

you can't really use sudo with npm it acts weird. So I did this instead to give myself sudo tech@tech-HP-Z620-Workstation:/ziti-console$ sudo chown -R $(whoami) /ziti-console
tech@tech-HP-Z620-Workstation:/ziti-console$ sudo chmod -R 775 /ziti-console

It's a brand new install, right? I see this path referenced: npm ERR! path: '/ziti-console/node_modules', did you make a folder at the root named /ziti-console? Are you following the normal quickstart instructions? I see from the instructions we just expect that you are doing this install with all the regular environment variables set from a network quickstart install but that's a very bad assumption and that should be spelled out clearly in the prerequisites and it's not at all! :angry:

Are you open to just reinstalling it? I assume you haven't gotten it installed properly? Did you install a quickstart on this machine? I can give you a short set of more generic instructions if you need.

If you have a quickstart on that computer, you should source the .env file it leaves behind, and then follow the instructions and it will "just work".

Hope that makes sense?

I am just doing a quickstart local install. I am making a ziti controller and a ZAC and a few tunnelers for admins that are offsite. Just running up test on my home machine before doing the real deal. I just wanted clarification if I was doing it wrong. I decided to install the ZAC before anything else, I was curious if I could do it first before the controller. That could of been my mistake as well. I love testing things until they break or break things before I test them. Thanks for the quick responses. You're a hero Clint

Everything worked after I installed the ziti controller.

tech@tech-HP-Z620-Workstation:/ziti-console$ npm install

removed 2 packages, and audited 454 packages in 1s

37 packages are looking for funding
run npm fund for details

2 moderate severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

Run npm audit for details.
tech@tech-HP-Z620-Workstation:/ziti-console$ npm fund
io.netfoundry.zac@2.9.2
├── Sponsor @philsturgeon on GitHub Sponsors · GitHub
│ └── @apidevtools/json-schema-ref-parser@10.0.1
├── Sponsor @ljharb on GitHub Sponsors · GitHub
│ └── qs@6.11.0, side-channel@1.0.4, call-bind@1.0.2, get-intrinsic@1.2.0, has-symbols@1.0.3, object-inspect@1.12.3, is-core-module@2.12.1
├── Sponsor @feross on GitHub Sponsors · GitHub
│ └── safe-buffer@5.2.1, buffer@6.0.3, base64-js@1.5.1, ieee754@1.2.1
├── GitHub - chalk/chalk: 🖍 Terminal string styling done right
│ └── chalk@5.3.0
├── Sponsor @sibiraj-s on GitHub Sponsors · GitHub
│ └── ci-info@3.8.0
├── Sponsor @isaacs on GitHub Sponsors · GitHub
│ └── glob@7.2.3, minimatch@9.0.3, json-stringify-nice@1.1.4, promise-all-reject-late@1.0.1, promise-call-limit@1.0.2, rimraf@3.0.2
├── Sponsor @sindresorhus on GitHub Sponsors · GitHub
│ └── p-map@4.0.0, defaults@1.0.4, make-dir@3.1.0
├── GitHub - chalk/supports-color: Detect whether a terminal supports color
│ └── supports-color@9.4.0
└── Sponsor @epoberezkin on GitHub Sponsors · GitHub
└── ajv@6.12.6

tech@tech-HP-Z620-Workstation:/ziti-console$

so that was my mistake at first.

Yeah. You CAN, but our doc is not structured for that (yet). I'll file an issue to make that very clear before you try to install it... Glad you got it working!

not really It was a false positive. I ran into another issue. Can you help me out?

tech@tech-HP-Z620-Workstation:/ziti-console$ npm start

io.netfoundry.zac@2.9.2 start
node server.js

node:fs:1395
handleErrorFromBinding(ctx);
^

Error: EACCES: permission denied, mkdir '/ziti-console/../ziti/'
at Object.mkdirSync (node:fs:1395:3)
at file:///ziti-console/server.js:174:5 {
errno: -13,
syscall: 'mkdir',
code: 'EACCES',
path: '/ziti-console/../ziti/'
}

Node.js v18.13.0

my system keeps insisting I am not the owner of ZAC. Its a constant permissions error. Maybe I need to change a few things. I doubt many people deal with these clown antics. Apologies, I must've added too many controls on my linux machine. In future reference in case anyone else comes across this issue. Here's how I fixed it. File ownership: sudo chown -R $(whoami) /ziti-console/assets/data/tags.json
sudo chown -R $(whoami) /ziti-console/../ziti/tags.json
File Permissions: sudo chmod 775 /ziti-console/assets/data/tags.json
sudo chmod 775 /ziti-console/../ziti/tags.json
Direcotry Permissions: sudo chmod -R 775 /ziti-console/assets/data
sudo chmod -R 775 /ziti-console/../ziti/

Here's the shortest set of instructions to get zac working with http (not TLS)

cd $HOME
git clone https://github.com/openziti/ziti-console.git
cd $HOME/ziti-console
npm install
node server.js

OR - If you installed the network first, you can follow the deployed doc, but you will need to source the .env file:

source $HOME/.ziti/quickstart/$(hostname -s)/$(hostname -s).env

Then when you follow the instructions, you'll get a ziti-console folder in $ZITI_HOME (which will be $HOME/.ziti/quickstart/$(hostname -s)/ziti-console

That get you what you need?