In my previous post, we have discussed about “Introduction to Node JS Platform“. Now we have some idea about what is Node JS and what is not Node JS.
In this post, we will discuss about “How to setup Node JS Base Environment” in Windows OS and Mac OS X.
Node JS Base Environment Setup on Windows
- Access Node JS Official Website “https://nodejs.org/en/”
Here we can find “INSTALL” button. If we want to download latest stable version, we can click on this button.If we want to select Node JS Platform based on our Hardware and Software requirements like Windows 32bit or 64bit OS, please click on “Downloads” button and select your required Node JS version to download.
Node.js Base Environment Setup on Mac OS X
For Mac OS X, download the pkg installer and run it. You will get below screens in order.
As you can see
from above image, /usr/local/bin should be in the PATH variable. Usually it’s there by default but you can check it using below command.
1 2 3 4 5 |
pankaj:~ pankaj$ echo $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin:/usr/local/apache-maven-3.0.5/bin: pankaj:~ pankaj$ |
Below are some sample commands to check the version and start Node CLI and exit it.
1 2 3 4 5 6 7 8 9 10 11 |
pankaj:~ pankaj$ node -v v0.12.1 pankaj:~ pankaj$ node > process.exit(); pankaj:~ pankaj$ node > (^C again to quit) > pankaj:~ pankaj$ |
Before starting some simple Node JS examples, we will discuss about Major Components of Node JS Platform in next post.