FalconStats icon indicating copy to clipboard operation
FalconStats copied to clipboard

Problem when running "node init.js"

Open mon0theist opened this issue 6 years ago • 6 comments

I get the following error output when running "node init.js" as shown in the directions:

module.js:549
    throw err;
    ^

Error: Cannot find module 'chalk'
    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/abdulhakeem/FalconStats/init.js:1:83)
    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)

mon0theist avatar Jul 11 '18 21:07 mon0theist

Nevermind, turns out I needed to install package node-chalk

mon0theist avatar Jul 12 '18 02:07 mon0theist

@Heholord can you add this to the package json and make sure we have the correct dependencies?

HermannBjorgvin avatar Jul 16 '18 13:07 HermannBjorgvin

@AbuFiraas @HermannBjorgvin it works with the described dependencies in package.json, did you run npm install first?

Heholord avatar Jul 16 '18 16:07 Heholord

@Heholord Yes I double checked that I've followed the instructions exactly, however now I'm getting a different issue when trying to run node init.js:

module.js:549
    throw err;
    ^

Error: Cannot find module 'clear'
    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/abdulhakeem/FalconStats/init.js:2:21)
    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)

mon0theist avatar Jul 20 '18 15:07 mon0theist

I think the problem is with the npm install

If, while in the FalconStats dir, I run npm install -g, it fails with a bunch of errors:

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/falconstats
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
/usr/local/lib
└── [email protected] 

npm ERR! Linux 4.15.0-23-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! path /usr/local/lib/node_modules/falconstats
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/falconstats'
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/falconstats'
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules/falconstats' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/abdulhakeem/FalconStats/npm-debug.log

However if I run as sudo npm install -g, then it seems to work, however when trying to run node init.js it can't seem to find any modules.

I'm able to manually install the modules with sudo npm install --save [module name] (while still in FalconStats dir) but it seems like a hack and not best practice

So idk if it's just me but something about the npm module installation doesn't seem to be working quite right

mon0theist avatar Jul 20 '18 16:07 mon0theist

I've now completed the initial setup script, but nothing happens when I actually login to my server, no FalconStats MOTD appears. I think the problem is with the symlink. It again doesn't work unless I run it as sudo, but I don't know exactly what it's linking to, I don't know where the falcon-motd folder is or where it's supposed to be, but it's not in the FalconStats cloned directory

mon0theist avatar Jul 20 '18 16:07 mon0theist