Nodemon: Nodemon should use node locally

Created on 26 Feb 2018  ·  5Comments  ·  Source: remy/nodemon

Feature Request

  • nodemon -v: 1.15.1
  • node -v: 9.5.0
  • Operating system/terminal environment: MacOS Sierra
  • Command you ran: npm run dev
    Script in package.json
    "dev": "nodemon index.js"

Expected behaviour

nodemon should use local node

Actual behaviour

nodemon use node installed globally

Steps to reproduce

https://twitter.com/housecor/status/962347301456015360

Watch this post, node can be installed locally now. Nodemon should check if node is installed locally, else, use node installed globally.
Kind regards,

has PR help wanted

All 5 comments

This is actually the same issue as when someone wants to use npm's auto resolving commands in .bin.

I wonder if npx has a module that does the resolution quickly…

Edit: I should precise that I use nodemon inside a script in my package.json (so the auto resolve for nodemon works well). It's only the auto resolve of node which fail.

#!/usr/bin/env node

Another problem is that nodemon use node to be executed...

I'm trying to use node and nodemon in a container (docker) where node isn't installed globally.

"start": "node index.js" Work
"dev": "nodemon index.js" doesn't work

I think it's due to the shebang but I don't know if there is a way to fix it...

Hmm, but /usr/bin/env should pick up that npm has introduced node_modules/.bin to the $PATH so I'm not quite sure _why_ it wouldn't work…

_Edit: Ignore it. The shebang works, it was another problem with my environment..._

Was this page helpful?
0 / 5 - 0 ratings