Akkadius / glass-isc-dhcp

Glass - ISC DHCP Server Interface
MIT License
686 stars 143 forks source link

Issue on start up - Cannot find Module 'asn1' #48

Closed FoobyGitHub closed 4 years ago

FoobyGitHub commented 4 years ago

Just setup a dhcp server in my house and spotted this lovely looking application.

I installed it as per the instructions, ran npm, it gave vulnerability errors which i asked it to fix. It only did some of them and i didn't apply and that said it would force break something.

however, on running npm start it complained of being unable to find module asn1.

Could you recommend how i go about diagnosing the problem?

root@router:/opt/glass-isc-dhcp# cat /etc/debian_version 9.9 root@router:/opt/glass-isc-dhcp# uname -a Linux router 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1 (2019-04-12) x86_64 GNU/Linux root@router:/opt/glass-isc-dhcp#

root@router:/opt/glass-isc-dhcp# npm audit fix npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

dhcpd-glass@0.0.0 start /opt/glass-isc-dhcp node ./bin/www

[Glass Server] Watching leases file '/var/lib/dhcp/dhcpd.leases' [Glass Server] Config watcher initialized [Glass Server] DHCP log watcher initialized [Glass Server] Websocket server starting on port: 8080 module.js:550 throw err; ^

Error: Cannot find module 'asn1' at Function.Module._resolveFilename (module.js:548:15) at Function.Module._load (module.js:475:25) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at Object. (/opt/glass-isc-dhcp/node_modules/sshpk/lib/formats/pem.js:9:12) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! dhcpd-glass@0.0.0 start: node ./bin/www npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the dhcpd-glass@0.0.0 start 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! /root/.npm/_logs/2019-08-21T20_47_02_802Z-debug.log

and the info from the debug.log

0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ] 2 info using npm@6.4.1 3 info using node@v8.16.1 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle dhcpd-glass@0.0.0~prestart: dhcpd-glass@0.0.0 6 info lifecycle dhcpd-glass@0.0.0~start: dhcpd-glass@0.0.0 7 verbose lifecycle dhcpd-glass@0.0.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle dhcpd-glass@0.0.0~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/opt/glass-isc-dhcp/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 9 verbose lifecycle dhcpd-glass@0.0.0~start: CWD: /opt/glass-isc-dhcp 10 silly lifecycle dhcpd-glass@0.0.0~start: Args: [ '-c', 'node ./bin/www' ] 11 silly lifecycle dhcpd-glass@0.0.0~start: Returned: code: 1 signal: null 12 info lifecycle dhcpd-glass@0.0.0~start: Failed to exec start script 13 verbose stack Error: dhcpd-glass@0.0.0 start: node ./bin/www 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16) 13 verbose stack at emitTwo (events.js:126:13) 13 verbose stack at EventEmitter.emit (events.js:214:7) 13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at emitTwo (events.js:126:13) 13 verbose stack at ChildProcess.emit (events.js:214:7) 13 verbose stack at maybeClose (internal/child_process.js:915:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 14 verbose pkgid dhcpd-glass@0.0.0 15 verbose cwd /opt/glass-isc-dhcp 16 verbose Linux 4.9.0-9-amd64 17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start" 18 verbose node v8.16.1 19 verbose npm v6.4.1 20 error code ELIFECYCLE 21 error errno 1 22 error dhcpd-glass@0.0.0 start: node ./bin/www 22 error Exit status 1 23 error Failed at the dhcpd-glass@0.0.0 start script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

mveplus commented 4 years ago

@FoobyGitHub I'm running a test on Ubuntu 18.04 TLS and hit the same error on the first run if you haven't solved the issue this did it for me: npm install asn1

Regards,

FoobyGitHub commented 4 years ago

@mveplus Perfect, thank you. Solved the issue. Totally didnt click it was an NPM module and i could have installed it.

Appreciate it