To install Node.js on Windows, download it from the official Website. Choose the 64-bit Windows installer package for the current LTS version, unless you know that you need a different option.
To install Node.js on macOS, use Homebrew.
If you use a Linux system that supports snaps for your development work, such as the Ubuntu desktop, you can install the Node.js snaps that are maintained by Nodesource. Otherwise, use the Nodesource package repositories.
A standard Node.js installation provides you with:
- Node.js itself
- An interactive shell (use the menu icon in Windows, or type node in a terminal window)
- The npm package manager to install extra software
Choosing a Code Editor or IDE
Git for Version Control
If you do not already use version control, you should install Git on your system. Git is now effectively the standard version control tool for developers.
Version control is obviously vital for collaborating with other programmers. It also enables you to efficiently copy your application to other systems for testing, deployment and backup.
If Git is installed, Atom and Visual Studio Code provide you with access to information and features from Git directly in their user interfaces. If you use Visual Studio Code, you should also consider installing the Git Lens extension, which enhances the integration with Git.
Set up ESLint in all of your projects to run code quality checks. Add Prettier, which will format your code, removing style issues. Prettier integrates with ESLint, so that ESLint formats your code with Prettier, and then checks the reformatted code.
Plugins enable the popular text editors and IDEs to integrate support for ESLint and Prettier, so that your code can be formatted and checked as you work.
Jest provides a comprehensive set of tools for testing. If you do not already have a preference, add Jest to your project.
Other Development Tools
You should probably learn these as you need them.
- Documentation.js - Documentation generator that uses the standard JSDoc format
- Nodemon - Instant code reloading during development
- Webpack - Web assets compiler
By design, Node.js only includes a very minimal library of modules. These packages offer commonly used items:
- Lodash - Library of common utility functions
- Math.js - Math library
- Moment.js - Date and time library
Express offers a basic package of features that you need for a Website or service, and is the most popular choice. Feathers builds on Express to provide support for REST APIs, real-time messaging, database access, and other capabilities. The hapi framework is designed for larger applications. Fastify is an emerging alternative to Express and Hapi.
Use the axios library for your Web client software, such as downloading files or working with APIs. The HTTP software that is included with Node.js uses callbacks, rather than the newer promises style of API.
Puppeteer enables you to automate copies of Google Chrome and Chromium Web browsers.
Knex provides a toolkit for working with SQL databases, including query building, connection handling, and schema migrations. Objection.js is an Object Relational Mapper (ORM) that builds on Knex. TypeORM is an emerging alternative to Knex and Objection.js, with a broader range of features. To work with MongoDB, use Mongoose.
Driver software required: To access a database service such as PostgreSQL, Redis, or MongoDB, you will need to install the appropriate Node.js driver.
Graphical Desktop Applications
To create desktop applications, use Electron.
Developing Command-line Tools
The tools for mobile and desktop application development build installable packages in the appropriate formats. To package other types of application, such as command-line tools, use pkg. This creates stand-alone executables that include Node.js itself, your code, and any other dependencies.
- NodeSchool - Free installable tutorials for Node.js
- Awesome Node.js - A huge list of software and resources for Node.js
- Node.js Best Practices
- Node.js Cheatsheet