nodemon -v
: 1.15.1node -v
: 9.5.0"dev": "nodemon index.js"
nodemon should use local node
nodemon use node installed globally
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,
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..._