# Ziti Admin Console nodejs problem

**URL:** <https://openziti.discourse.group/t/ziti-admin-console-nodejs-problem/1979>\
**Category:** Ziti Overlay\
**Created:** [January 12, 2024, 12:29pm UTC](https://openziti.discourse.group/t/ziti-admin-console-nodejs-problem/1979 "2024-01-12T12:29:28Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jheng](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@Jheng](https://openziti.discourse.group/u/Jheng)\
**Post date:** [January 12, 2024, 12:29pm UTC](https://openziti.discourse.group/t/ziti-admin-console-nodejs-problem/1979/1 "2024-01-12T12:29:28Z")

</div>

Hi everyone:

I am new using Openziti.  
When I create ziti admin console and run following code, it shows some errors.  
Could could please share some idea to solve it?

Thank you very much

user@user-virtual-machine:~/.ziti/quickstart/user-virtual-machine/ziti-console$ node "${ZITI\_HOME}/ziti-console/server.js"  
node:fs:590  
handleErrorFromBinding(ctx);  
^

Error: ENOENT: no such file or directory, open '/home/user/.ziti/quickstart/user-virtual-machine/ziti-console/dist/ziti-console-lib/assets/templates/header.htm'  
at Object.openSync (node:fs:590:3)  
at Object.readFileSync (node:fs:458:35)  
at file:///home/user/.ziti/quickstart/user-virtual-machine/ziti-console/server.js:84:17 {  
errno: -2,  
syscall: 'open',  
code: 'ENOENT',  
path: '/home/user/.ziti/quickstart/user-virtual-machine/ziti-console/dist/ziti-console-lib/assets/templates/header.htm'  
}  
user@user-virtual-machine:~/.ziti/quickstart/user-virtual-machine/ziti-console$ npm -v  
8.19.4  
user@user-virtual-machine:~/.ziti/quickstart/user-virtual-machine/ziti-console$ nodejs -v  
Command 'nodejs' not found, but can be installed with:  
sudo apt install nodejs  
user@user-virtual-machine:~/.ziti/quickstart/user-virtual-machine/ziti-console$ node -v  
v16.20.2  
user@user-virtual-machine:~/.ziti/quickstart/user-virtual-machine/ziti-console$

---

<div class="post-metadata">

**Author:** ![TheLumberjack](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/thelumberjack/32/113_2.png) [@TheLumberjack](https://openziti.discourse.group/u/TheLumberjack)\
**Post date:** [January 12, 2024, 1:13pm UTC](https://openziti.discourse.group/t/ziti-admin-console-nodejs-problem/1979/2 "2024-01-12T13:13:07Z")

</div>

Hi @Jheng, did you follow the ZAC quickstart exactly as outlined? That looks to me like somehow the "build the angular app" step was missed? Did you maybe pull recently and miss that the app build process changed slightly?

![image](https://global.discourse-cdn.com/free1/uploads/netfoundry/original/2X/c/c4e370e8246cdf139af5af4ce9367a7083e6aecd.png)

Did that succeed for you? @rgalletto fyi

---

<div class="post-metadata">

**Author:** ![Jheng](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@Jheng](https://openziti.discourse.group/u/Jheng)\
**Post date:** [March 20, 2024, 1:41am UTC](https://openziti.discourse.group/t/ziti-admin-console-nodejs-problem/1979/3 "2024-03-20T01:41:12Z")

</div>

I can build ng but I can create ng but it gives an error message

pm ERR! code EACCES  
npm ERR! syscall mkdir  
npm ERR! path /usr/lib/node\_modules/@angular  
npm ERR! errno -13  
npm ERR! Error: EACCES: permission denied, mkdir '/usr/lib/node\_modules/@angular'  
npm ERR! at async mkdir (node:internal/fs/promises:859:10)  
npm ERR! at async /usr/lib/node\_modules/npm/node\_modules/@npmcli/arborist/lib/arborist/reify.js:546:20  
npm ERR! at async Promise.allSettled (index 0)  
npm ERR! at async [reifyPackages] (/usr/lib/node\_modules/npm/node\_modules/@npmcli/arborist/lib/arborist/reify.js:246:11)  
npm ERR! at async Arborist.reify (/usr/lib/node\_modules/npm/node\_modules/@npmcli/arborist/lib/arborist/reify.js:165:5)  
npm ERR! at async Install.exec (/usr/lib/node\_modules/npm/lib/commands/install.js:153:5)  
npm ERR! at async module.exports (/usr/lib/node\_modules/npm/lib/cli-entry.js:61:5)  
npm ERR! Error: EACCES: permission denied, mkdir '/usr/lib/node\_modules/@angular'  
npm ERR! at async mkdir (node:internal/fs/promises:859:10)  
npm ERR! at async /usr/lib/node\_modules/npm/node\_modules/@npmcli/arborist/lib/arborist/reify.js:546:20  
npm ERR! at async Promise.allSettled (index 0)  
npm ERR! at async [reifyPackages] (/usr/lib/node\_modules/npm/node\_modules/@npmcli/arborist/lib/arborist/reify.js:246:11)  
npm ERR! at async Arborist.reify (/usr/lib/node\_modules/npm/node\_modules/@npmcli/arborist/lib/arborist/reify.js:165:5)  
npm ERR! at async Install.exec (/usr/lib/node\_modules/npm/lib/commands/install.js:153:5)  
npm ERR! at async module.exports (/usr/lib/node\_modules/npm/lib/cli-entry.js:61:5) {  
npm ERR! errno: -13,  
npm ERR! code: 'EACCES',  
npm ERR! syscall: 'mkdir',  
npm ERR! path: '/usr/lib/node\_modules/@angular'  
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: /home/user/.npm/\_logs/2024-03-19T08\_56\_37\_049Z-debug-0.log

run node "${ZITI\_HOME}/ziti-console/server.js"

{  
edgeControllers: ,  
bindIP: '',  
editable: true,  
update: false,  
location: '../ziti',  
port: 1408,  
portTLS: 8443,  
logo: '',  
primary: '',  
secondary: '',  
allowPersonal: true,  
rejectUnauthorized: false,  
mail: { host: '', port: 25, secure: false, auth: { user: '', pass: '' } },  
from: '',  
to: ''  
}  
TLS initialized on port: 8443  
(node:31037) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.  
(Use `node --trace-deprecation ...` to show where the warning was created)  
Ziti Admin Console is now listening on port 1408

May I ask which step I made wrong?

node 21.7.1  
npm 10.5.0

---

<div class="post-metadata">

**Author:** ![TheLumberjack](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/thelumberjack/32/113_2.png) [@TheLumberjack](https://openziti.discourse.group/u/TheLumberjack)\
**Post date:** [March 20, 2024, 1:43am UTC](https://openziti.discourse.group/t/ziti-admin-console-nodejs-problem/1979/4 "2024-03-20T01:43:52Z")

</div>

You need to read the error messages more closely. It looks like you have permission problems?

```auto
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.

```

---

<div class="post-metadata">

**Author:** ![Jheng](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@Jheng](https://openziti.discourse.group/u/Jheng)\
**Post date:** [March 20, 2024, 1:51am UTC](https://openziti.discourse.group/t/ziti-admin-console-nodejs-problem/1979/5 "2024-03-20T01:51:35Z")

</div>

Yes,I'm just checking again to see if it's a permissions issue.  
Because I added sudo before, it was ok.

punycode module has been deprecated  
How should I correct him?

---

<div class="post-metadata">

**Author:** ![TheLumberjack](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/thelumberjack/32/113_2.png) [@TheLumberjack](https://openziti.discourse.group/u/TheLumberjack)\
**Post date:** [March 20, 2024, 1:52am UTC](https://openziti.discourse.group/t/ziti-admin-console-nodejs-problem/1979/6 "2024-03-20T01:52:47Z")

</div>

it's up to you as to the proper way to correct it... if it were me, I'd probably remove the cloned repo, reclone it and try again. but you can chmod it if you want, there are lots of ways. I don't think I can tell you "the one way" to do it

---

<div class="post-metadata">

**Author:** ![Jheng](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@Jheng](https://openziti.discourse.group/u/Jheng)\
**Post date:** [March 20, 2024, 1:59am UTC](https://openziti.discourse.group/t/ziti-admin-console-nodejs-problem/1979/7 "2024-03-20T01:59:03Z")

</div>

OK  
Let me think about it and try again  
Thanks

---

<div class="post-metadata">

**Author:** ![Jheng](https://avatars.discourse-cdn.com/v4/letter/j/9fc348/32.png) [@Jheng](https://openziti.discourse.group/u/Jheng)\
**Post date:** [March 20, 2024, 9:13am UTC](https://openziti.discourse.group/t/ziti-admin-console-nodejs-problem/1979/8 "2024-03-20T09:13:52Z")

</div>

{  
edgeControllers: ,  
bindIP: '',  
editable: true,  
update: false,  
location: '../ziti',  
port: 1408,  
portTLS: 8443,  
logo: '',  
primary: '',  
secondary: '',  
allowPersonal: true,  
rejectUnauthorized: false,  
mail: { host: '', port: 25, secure: false, auth: { user: '', pass: '' } },  
from: '',  
to: ''  
}  
TLS initialized on port: 8443  
(node:8699) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.  
(Use `node --trace-deprecation ...` to show where the warning was created)  
Port 1408 In Use, Attempting new port 1409  
TLS initialized on port: 8443  
node:events:497  
throw er; // Unhandled 'error' event  
^

Error: listen EADDRINUSE: address already in use :::8443  
at Server.setupListenHandle [as \_listen2] (node:net:1897:16)  
at listenInCluster (node:net:1945:12)  
at Server.listen (node:net:2037:7)  
at StartServer (file:///home/user/.ziti/quickstart/user-virtual-machine/ziti-console/server.js:2046:15)  
at file:///home/user/.ziti/quickstart/user-virtual-machine/ziti-console/server.js:1978:1  
Emitted 'error' event on Server instance at:  
at emitErrorNT (node:net:1924:8)  
at process.processTicksAndRejections (node:internal/process/task\_queues:82:21) {  
code: 'EADDRINUSE',  
errno: -98,  
syscall: 'listen',  
address: '::',  
port: 8443  
}

Node.js v21.7.1

Sorry, I want to ask. After reinstalling and running server.js, the following situation occurred. I don’t know if it is correct.  
Can you help me?  
Thanks

---

<div class="post-metadata">

**Author:** ![rgalletto](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/rgalletto/32/1508_2.png) [@rgalletto](https://openziti.discourse.group/u/rgalletto)\
**Post date:** [March 20, 2024, 12:43pm UTC](https://openziti.discourse.group/t/ziti-admin-console-nodejs-problem/1979/9 "2024-03-20T12:43:45Z")

</div>

Based on the console logs, the ZAC server should be up and running. If you try to access the console via `http://` on port `1409`, or `https://` on port `8443`, I expect you should be able to login.

There does appear to be a minor bug in the startup script for `server.js` which is what is causing the error logs you're seeing. Basically, if the server has to retry starting on a different port than the default (ie. `1408` -\> `1409` based on your logs) it will also retry the TLS port again as well. Since the server was already able to initialize on `8443` the first time, it then threw an error on the second attempt since the address was already in use.

We'll get this retry logic cleaned up, but in the meantime your ZAC should hopefully be up and running. Let us know though if you're still having issues.

---

<div class="post-metadata">

**Author:** ![rgalletto](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/rgalletto/32/1508_2.png) [@rgalletto](https://openziti.discourse.group/u/rgalletto)\
**Post date:** [March 20, 2024, 1:45pm UTC](https://openziti.discourse.group/t/ziti-admin-console-nodejs-problem/1979/10 "2024-03-20T13:45:41Z")

</div>

> After reinstalling and running server.js, the following situation occurred.

@Jheng also just one other question.. do you still have a previous instance of ZAC running already? Or maybe another program that's running on port `1408`? If so, you might also want to try shutting the other instance down first before running the latest.
