Factsheet
The command line for that is:
node -v
Or
node --version
Note:
If node -v doesn't work, but nodejs -v does, then something's not set up quite right on your system. See this other question for ways to fix it.
If you're referring to the shell command line, either of the following will work:
node -v
node --version
Just typing node version will cause node.js to attempt loading a module named version, which doesn't exist unless you like working with confusing module names.
What version of node do you use?
Node js 14 vs current version
NODE_VERSION env variable ignored?
node.js - What uses / respects the .node-version file? - Stack Overflow
Videos
Are people upgrading to node 18? I have my own thoughts but want this poll to play out first.
» npm install node
Hi, i m new node js developer i found a great free course which use node 14 the course is dated to 2021 is it worth it to learn it and what is the major difference between v14 and current version? Thanks
.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.