nvm exec 18 node script.js

Category: Node.js & npm/yarn

nvm exec 18 node script.js

Run a command using a specific Node.js version without permanently switching

Runs a command using a specific Node.js version for just that one command, without switching your session's active version.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.