How to check if Node js is installed and check Node js version
Yep, I have had to do this on more than one occasion too. In order to check if you have Node js installed, or how to check your Node js version, follow these steps:
Open your command line tool (as above, Terminal, Command, Git Bash etc.)
Type node -v
This will print a version number if you do have node installed
You can see in this image the line where I’ve typed node -v and then pressed return, and then the subsequent response of the version number. You can use this for any npm package as well by typing packagename -v to find out if it’s installed, and if so, what version you have.
how to check if you have node installed or check your node js version
So to run a node js file in terminal / command / git bash you simply type ‘node‘ followed by the filename and include the .js extension:
node myfilename.js
how to run a node js file in a terminal
Comments
Post a Comment