.node-version is a file read by various tools on an individual basis for specifying the target node version. Version managers which use/respect it include (in alphabetical order):
- asdf-nodejs Node.js plugin for asdf version manager. (macOS, Linux)
- avn Automatic Version Switching for Node. (macOS, Linux)
- chnode Changes shell's current Node.js version by updating $PATH (macOS, Linux)
- dev
devis built on pkgx, a single, standalone binary that can run anything (macOS, Linux) - direnv unclutter your .profile. (macOS, Linux)
- fnm Fast and simple Node.js version manager, built in Rust. (macOS, Linux, Windows)
- mise Polyglot switcher compatible with asdf plugins, built in Rust. (macOS, Linux)
- n Interactively Manage Your Node.js Versions. (macOS, Linux)
- nenv Groom your app’s Node environment with nenv (macOS, Linux)
- nodeenv Virtual environment for Node.js & integrator with virtualenv (macOS, Linux, Windows)
- nodenv Manage multiple NodeJS versions. (macOS, Linux)
- nodist Natural node.js and npm version manager for windows. (Windows)
- nve Run any command on specific Node.js versions (macOS, Linux, Windows)
- nvm-rust A cross-platform node version manager that doesn't suck (macOS, Linux, Windows)
- nvm.fish Node.js version manager lovingly made for Fish. (macOS, Linux)
- nvs Node Version Switcher - A cross-platform tool for switching between versions and forks of Node.js. (macOS, Linux, Windows)
- setup-node (configuration) Set up your GitHub Actions workflow with a specific version of node.js
- vfox The Multiple SDK Version Manager
Other products which use .node-version include:
- bitrise The CI/CD Platform built for Mobile DevOps
- Cloudflare Pages Build fast sites. In record time.
- Hostman Hosting platform that deploys your web applications
- netlify Instantly build and deploy your sites to our global network from Git.
- paketo Your app, in your favorite language, ready to run in the cloud
- preferred-node-version Get the preferred Node.js version of a project or user
- Pulumi Deployments Automate, Secure, and Manage Everything You Run in the Cloud
- ReadyMage Magento 2 and PWA managed auto-scalable infrastructure hosting service.
- render A Cloud for the New Decade
- Spaceship Minimalistic, powerful and extremely customizable Zsh prompt
- starship The minimal, blazing-fast, and infinitely customizable prompt for any shell!
- typescript-action Create a TypeScript Action with tests, linting, workflow, publishing, and versioning
- Vercel Conformance Conformance provides tools that run automated checks on your code for product critical issues, such as performance, security, and code health.
- VMware Tanzu The Tanzu Node.js Buildpack supports several popular configurations for Node.js apps.
Note: nvm does not support reading a .node-version file.
I documented usage and some supported features here: https://github.com/shadowspawn/node-version-usage
Answer from shadowspawn on Stack Overflow.node-version is a file read by various tools on an individual basis for specifying the target node version. Version managers which use/respect it include (in alphabetical order):
- asdf-nodejs Node.js plugin for asdf version manager. (macOS, Linux)
- avn Automatic Version Switching for Node. (macOS, Linux)
- chnode Changes shell's current Node.js version by updating $PATH (macOS, Linux)
- dev
devis built on pkgx, a single, standalone binary that can run anything (macOS, Linux) - direnv unclutter your .profile. (macOS, Linux)
- fnm Fast and simple Node.js version manager, built in Rust. (macOS, Linux, Windows)
- mise Polyglot switcher compatible with asdf plugins, built in Rust. (macOS, Linux)
- n Interactively Manage Your Node.js Versions. (macOS, Linux)
- nenv Groom your app’s Node environment with nenv (macOS, Linux)
- nodeenv Virtual environment for Node.js & integrator with virtualenv (macOS, Linux, Windows)
- nodenv Manage multiple NodeJS versions. (macOS, Linux)
- nodist Natural node.js and npm version manager for windows. (Windows)
- nve Run any command on specific Node.js versions (macOS, Linux, Windows)
- nvm-rust A cross-platform node version manager that doesn't suck (macOS, Linux, Windows)
- nvm.fish Node.js version manager lovingly made for Fish. (macOS, Linux)
- nvs Node Version Switcher - A cross-platform tool for switching between versions and forks of Node.js. (macOS, Linux, Windows)
- setup-node (configuration) Set up your GitHub Actions workflow with a specific version of node.js
- vfox The Multiple SDK Version Manager
Other products which use .node-version include:
- bitrise The CI/CD Platform built for Mobile DevOps
- Cloudflare Pages Build fast sites. In record time.
- Hostman Hosting platform that deploys your web applications
- netlify Instantly build and deploy your sites to our global network from Git.
- paketo Your app, in your favorite language, ready to run in the cloud
- preferred-node-version Get the preferred Node.js version of a project or user
- Pulumi Deployments Automate, Secure, and Manage Everything You Run in the Cloud
- ReadyMage Magento 2 and PWA managed auto-scalable infrastructure hosting service.
- render A Cloud for the New Decade
- Spaceship Minimalistic, powerful and extremely customizable Zsh prompt
- starship The minimal, blazing-fast, and infinitely customizable prompt for any shell!
- typescript-action Create a TypeScript Action with tests, linting, workflow, publishing, and versioning
- Vercel Conformance Conformance provides tools that run automated checks on your code for product critical issues, such as performance, security, and code health.
- VMware Tanzu The Tanzu Node.js Buildpack supports several popular configurations for Node.js apps.
Note: nvm does not support reading a .node-version file.
I documented usage and some supported features here: https://github.com/shadowspawn/node-version-usage
There are a few version managers for node.js respecting .node-version file:
- avn - Automatic Node Version Switching
- nodenv - Yet another version managers
- asdf - Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more, provided you configure it accordingly
- nvs - Node Version Switcher
There may be some other version managers, but I'm not aware of them.
I don't know which particular version manager Atom uses. nodenv have more stars on GitHub, but avn looks more mature and better maintained for me, not to mention its compatibility with both n and nvm.
Videos
I love the node version manager, since different projects might require different node versions for various reasons - often the CI/CD tooling or cloud infrastructure requirements.
The problem I have is when switching between projects, I need to remember to run nvm use.
To make sure I don't forget, I fill in the engines section like this:
"engines" : {"npm" : ">=8.0.0 <9.0.0","node" : ">=18.0.0 <19.0.0"
}
However, is there a nicer way where I don't have to switch, and somehow things are symlinked to the right place.
I use Windows out of habit, but happy for a Linux answer as I am happy to work there too.
» npm install n