Skip to content

Instantly share code, notes, and snippets.

@coisa
Created July 29, 2022 15:54
Show Gist options
  • Select an option

  • Save coisa/20678c0b9dc6161c7ee5ca058b0ad604 to your computer and use it in GitHub Desktop.

Select an option

Save coisa/20678c0b9dc6161c7ee5ca058b0ad604 to your computer and use it in GitHub Desktop.
Example of how to use a shebang for a specific NodeJS version through NVM
#!/usr/bin/env -S ${NVM_DIR}/versions/node/v17.9.1/bin/node
// Don't forget to run `chmod +x index.js`
// Always run the script directly, with the following command: `./index.js` instead of `node index.js`
console.log(`You are running node with the version: ${process.version}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment