While we believe that this content benefits our community, we have not yet thoroughly reviewed it. If you have any suggestions for improvements, please let us know by clicking the “report an issue“ button at the bottom of the tutorial.
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.
PATH=C:\Users\[username]\AppData\Roaming\npm;D:\NodeJS.V.0.12.0\;%PATH%
node –v
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.
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.
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.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in our Questions & Answers section, find tutorials and tools that will help you grow as a developer and scale your project or business, and subscribe to topics of interest.
Sign up