Node js Version Check
In Node.js, you can check the version of Node.js that is currently installed on your system using the process.versions object or by using the node -v command in the command prompt or terminal.
Here are a few examples:
console.log(process.versions.node); // Output: 12.18.3 (or the version of Node.js currently installed on your system)
console.log(process.version); // Output: v12.18.3 (or the version of Node.js currently installed on your system)
You can also check the version of Node.js by running the following command in the command prompt or terminal:
node -v
This will output the version of Node.js currently installed on your system. For example, it may return something like v12.18.3
It's also worth mentioning that you can check the version of npm package manager by running the following command:
npm -v
This will output the version of npm package manager currently installed on your system.
It's also worth noting that, if you are using a Node Version Manager (NVM) like nvm or n, you can use the NVM command to check the version of Node.js that is currently active.
0 Comments