Created
July 29, 2022 15:54
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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