In order to use almost any development tools based in JavaScript, you’ll need to know how to use npm and Node.js. GulpGrunt, and Webpack are a few examples of popular technologies you may have heard of that require a knowledge of the Node ecosystem.

I find myself writing about this over and over again in the prerequisites of an article I’ve begun to write. I’d prefer to write one definitive guide to refer to in the future, so here it is.

Prerequisites

  • Basic command line proficiency. Don’t skip this step! If you don’t know how to use the command line, you’ll be fighting an uphill battle. The provided tutorial has everything you need to know.

Goals

  • Learn what Node.js and npm are
  • Set up Node.js and npm on Windows and Mac

What is Node.js?

JavaScript is a client-side programming language, which means it’s processed in the browser. With the advent of Node.js, JavaScript can also be used as a server-side language.

What is npm?

npm doesn’t stand for Node Package Manager*, which means it’s the tool to connect to the repository containing all the Node.js programs, plugins, modules and so on.

*npm actually does not stand for “Node Package Manager” but essentially that’s what it is and does, so most people refer to it that way.

Local vs. Global

This is the most confusing concept to understand at first, so it’s important to let this settle in. Traditionally, you’re used to globally installing any sort of program or software on your computer. If you want Spotify, you’ll download Spotify, and then it will be available to you.

With npm, you will have some global installs, but mostly everything will be done on a local project basis, meaning you’ll have to install everything you need for each project in its own directory. If you want to have a project running Gulp and Sass, you’ll create a directory, with a new npm install.

For future reference, any global installations will have the -g flag.

#javascript #node #tutorial #npm

Node.js and Npm Tutorial: Installation and Usage
1.10 GEEK