A Beginner’s Guide to Node.js Installation on Windows, Linux, and Mac

What is NPM?

NPM (short for Node Package Manager) is a package manager for the JavaScript programming language. It is the default package manager for the JavaScript runtime environment Node.js. NPM helps manage and share the packages (libraries, frameworks, tools, etc.) that are needed for a project, making it easier to develop and maintain applications. NPM is included with Node.js, so if you have Node.js installed on your computer, you already have npm. You can use npm to install and manage packages from the command line, and it is also possible to use it for publishing your packages.

Components of NPM

  • NPM Registry:- The npm registry is an extensive database of npm packages that developers can publish and download from. It is a repository of reusable code that developers can use in their projects. Developers can publish their packages to the npm registry by using the “npm publish” command.
    This command takes the code and other assets in the current directory and packages them into an npm package, which is then uploaded to the registry.
  • CLI:- The npm Command Line Interface (CLI) is a command-line tool that allows you to run npm commands. These commands allow you to perform various tasks related to npm, such as installing packages, publishing packages, and managing dependencies.
    To use the npm CLI, you will need to have Node.js and npm installed on your computer. Once you have these tools installed, you can open a terminal or command prompt and type "npm” followed by the command you want to run.

What is Node.js?

Node.js is an open-source, cross-platform JavaScript runtime environment that executes JavaScript code outside of a web browser. Node.js allows developers to run JavaScript on the server side, creating back-end applications with JavaScript.

Node.js is built on Google Chrome’s V8 JavaScript engine, and it allows developers to create scalable network applications quickly using JavaScript. Node.js uses an event-driven, non-blocking I/O model, which makes it lightweight and efficient. It is particularly well-suited for real-time applications that require a lot of data exchange, such as chat apps and online games.

Node.js also comes with a package manager called npm, which stands for Node Package Manager. npm makes it easy to install and manage packages (collections of code and other assets) that you can use in your Node.js applications. There are thousands of open-source packages available on the npm registry, which you can use to save time and build robust applications more quickly.

Node.js is widely used in the development of web applications, and it has a large and active developer community. It is supported by several companies and organizations, and it has a strong ecosystem of tools and libraries that make it easy to build and deploy applications.

Prerequisites:

The minimum system requirements for installing and running Node.js are:

  • A processor that supports the SSE2 instruction set (most processors made in the past 10 years support this)
  • At least 512 MB of RAM
  • A hard drive with at least 50 MB of free space

These requirements are quite low, and most modern computers should easily meet them. However, the actual system requirements for a specific Node.js application will depend on the needs of that application. If you are building a resource-intensive application, you may need a more powerful machine with more RAM and faster processors.

In terms of operating systems, Node.js is supported on the following platforms:

  • Windows 7 and later
  • macOS 10.12 (Sierra) and later
  • Most flavors of Linux, including Ubuntu, Debian, and CentOS

You can download the latest version of Node.js from the official website at https://nodejs.org/

How to install Node.js and NPM on Windows?

To install node js on your system visit the above link and download the latest LTS(Long Term Support) version of node js.

Once downloaded you can install it as any package installed on your windows machine. Follow the image below for your reference.

You are now ready to run your js inside Nodejs. Just open your Command Prompt and run the command “node”

How to install Node.js and NPM on Linux?

Leave a Comment