FormidableLabs / nodejs-dashboard

Telemetry dashboard for node.js apps from the terminal!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bash: nodejs-dashboard: command not found

svennidal opened this issue · comments

I did:
"npm install nodejs-dashboard --save-dev"
added "require('nodejs-dashboard')" to the top of my app.js
ran "nodejs-dashboard node app.js" from the command-line and get this error:

"bash: nodejs-dashboard: command not found"

EDIT: Ran it in a npm script and it's beautiful. This will be on one of my monitors for all the projects I work on.

You have to install it globally.
npm install nodejs-dashboard --save-dev -g
The docs need to be updated accordingly

You have to run it as an npm script if you're not installing it globally (which is fine). Per the README:

"scripts": {
    "dev": "nodejs-dashboard node index.js"
  }

Then you can do npm run dev and it should work. This is because npm scripts load the node_modules/.bin folder into the PATH when running, and that's where the executable is.

@svennidal as noted you'll need to run as a script. Alternatively you could access the bin directly using:

./node_modules/nodejs-dashboard/bin/nodejs-dashboard.js ... but the preferred method at this time is via script.

Thanks! 👍