Nodejs: Change working directory when running node bin script
- by user2433617
I am trying to change the working directory when my nodejs script is run from a bin script.
So simplified I have something like:
#!/usr/bin/env node
process.cd('/Users')
When I then run this command like ./bin/nodefile it exits but stays in the same directory it started in.
I have also tried shelljs,
What is the best way to do this? I…