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.
To install Node.js on Linux, use the recommended installation process for your distribution, or a Docker image. If the distribution supports snaps, you can also install Node.js as a snap. Snaps automatically update, so are not suitable for situations where you need a reproducible environment. Nodesource maintain the Linux packages for popular distributions, and Docker, Inc. maintain the Docker images.
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 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
- PM2 - Process manager for Node.js applications
- 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
- Winston - Logging
Express offers the basic elements that you need for a Website or service, along with support for a large range of plugins, 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 that can use Express plugins.
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.
Cheerio provides an implementation of the jQuery API for reading and processing HTML documents with Node.js.
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
Developing Command-line Tools
To create command-line tools with Node.js, use either Commander, or the Open CLI Framework. Commander is the most popular choice for building command-line utilities. The Open CLI Framework was developed by Heroku for their command-ine tools, and then released as an Open Source project in 2018.
To package command-line tools, use pkg. This creates stand-alone executables that include Node.js itself, your code, and any other dependencies.
Robotics and Internet of Things
- freeCodeCamp - Free courses for new programmers
- NodeSchool - Free installable tutorials for Node.js
- MDN Web Docs - The standard resource for Web technologies, maintained by Mozilla
- Awesome Node.js - A huge list of software and resources for Node.js
- Node.js Best Practices
- Node.js Cheatsheet