To install Node.js, you have several choices based on your operating system and your comfort with building from source code.
This book assumes you are using the latest stable version of Node.js 8. If you install a different version—for example, by building from the latest source code—the code examples in this book may not work. From the command line you can run node --version to see what version you have installed if you are not sure:
| | $ node --version |
| | v8.0.0 |
One of the easiest ways to get Node.js is to download an installer from nodejs.org.[14]
Another popular option (the one that I use personally) is Node.js Version Manager (nvm).[15] If you’re using a Unix-like OS (such as Mac OS X or Linux), you can install nvm like so:
| | $ curl https://raw.github.com/creationix/nvm/master/install.sh | sh |
Then install a specific version:
| | $ nvm install v8.0.0 |
If you have trouble, you can get help on the Node.js mailing lists and IRC channel, both linked from the Node.js community page.[16]
We’ve got a lot of ground to cover, and we don’t have many pages to do it. So if you’re ready, let’s begin in the oh-so-familiar domain of filesystem access.