key-networks / ztncui

ZeroTier network controller UI
GNU General Public License v3.0
1.53k stars 228 forks source link

New Compile Error #68

Open jimthedj65 opened 3 years ago

jimthedj65 commented 3 years ago

Hi there,

I cloned the repo today and everything ran fine until I hit the npm start section and got the error below, I am running a fresh ubuntu 18.04 install with all dependencies around npm, node.js, argon2 etc

npm start

> ztncui@0.7.1 start /home/myhome/ztncui/src
> node ./bin/www

module.js:549
    throw err;
    ^

Error: Cannot find module 'argon2'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/myhome/ztncui/src/controllers/auth.js:7:16)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

npm ERR! Linux 4.15.0-143-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! ztncui@0.7.1 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ztncui@0.7.1 start script 'node ./bin/www'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ztncui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/www
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ztncui
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ztncui
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/myhome/ztncui/src/npm-debug.log

any pointers appreciated

bug output

npm bugs ztncui
npm ERR! Linux 4.15.0-143-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "bugs" "ztncui"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code E404

npm ERR! 404 Not found : ztncui
npm ERR! 404
npm ERR! 404  'ztncui' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/myhome/ztncui/src/npm-debug.log
lideming commented 3 years ago

Did you run npm install in the cloned repo?

jimthedj65 commented 3 years ago

Did you run npm install in the cloned repo?

I ran it in the ztncui/src dir where the package.json resides?

jimthedj65 commented 3 years ago

I downloaded it a second time and got a different error

npm WARN optional Skipping failed optional dependency /chokidar/fsevents: npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.13 npm ERR! Linux 4.15.0-143-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code ELIFECYCLE

npm ERR! argon2@0.19.3 install: node-gyp rebuild npm ERR! Exit status 7 npm ERR! npm ERR! Failed at the argon2@0.19.3 install script 'node-gyp rebuild'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the argon2 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs argon2 npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls argon2 npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/myhome/projects/ztncui/src/npm-debug.log

jimthedj65 commented 3 years ago

NAME="Ubuntu" VERSION="18.04.5 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.5 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic

jimthedj65 commented 3 years ago

I did notice that argon2 is missing from the node_modules directory, not sure if its relevant, the first error was pointing to that specifically.

jimthedj65 commented 3 years ago

I was able to build this on my Mac Book Pro, must be something with my Ubuntu 18.04 setup kernel ? any details on the dev and kernel supported?

lideming commented 3 years ago

It seems that node-gyp failed to build argon2 on Ubuntu, probably because build tools are missing. Try sudo apt install build-essential.

jimthedj65 commented 3 years ago

I completely checked my build carefully and noticed I was running npm v10 instead of the minimum 14 you highlighted. I now have the below structure. I did have build-essentials installed etc, this is my lack of understanding with npm, and wasn't aware until I installed nvm.

nvm ls -> v14.17.0 v16.2.0 system default -> node (-> v16.2.0) iojs -> N/A (default) unstable -> N/A (default) node -> stable (-> v16.2.0) (default) stable -> 16.2 (-> v16.2.0) (default) lts/* -> lts/fermium (-> v14.17.0) lts/argon -> v4.9.1 (-> N/A) lts/boron -> v6.17.1 (-> N/A) lts/carbon -> v8.17.0 (-> N/A) lts/dubnium -> v10.24.1 (-> N/A) lts/erbium -> v12.22.1 (-> N/A) lts/fermium -> v14.17.0

jimthedj65 commented 3 years ago

I also found some vulnerabilities on the first install, I think I will write up a detailed tutorial on how to get the environment ready for modifying or forking ztncui. This finally got me a working environment.

 === npm audit security report ===                        

# Run  npm install pug@3.0.2  to resolve 1 vulnerability
SEMVER WARNING: Recommended action is a potentially breaking change

  High            Remote Code Execution                                         

  Package         pug                                                           

  Dependency of   pug                                                           

  Path            pug                                                           

  More info       https://npmjs.com/advisories/1643                             

found 1 high severity vulnerability in 416 scanned packages
  1 vulnerability requires semver-major dependency updates.
install pug@3.0.2
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ pug@3.0.2
added 5 packages from 3 contributors, removed 27 packages, updated 19 packages and audited 394 packages in 4.573s

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
jimthedj65 commented 3 years ago

further to add I got this running on Debian 10 build with a nested LXC build