Skip to content

Instantly share code, notes, and snippets.

@szepnapot
Last active March 25, 2018 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szepnapot/0f0fccc31aaf94a8dedf86c11e61b5cf to your computer and use it in GitHub Desktop.
Save szepnapot/0f0fccc31aaf94a8dedf86c11e61b5cf to your computer and use it in GitHub Desktop.
Node + NPM installation guide

Table of Contents

  1. Requirements
  2. Installation
  3. Test

Requirements

You need a shell.

Eg.:

  • Windows: Windows Command Prompt, PowerShell, Cygwin, or the Git shell (which is installed along with Github for Windows)
  • UNIX: bash, zsh ...

Installation

  1. Download the installer from Node.js® website
  2. Run the installer
  3. Follow the prompts in the installer (Accept the license agreement, click the NEXT button a bunch of times and accept the default installation settings)

On Windows:

  1. Restart your computer. (You won’t be able to run Node.js® until you restart your computer.)

Test the installation

  1. Test Node
    To see if Node is installed, open the Windows Command Prompt, Powershell or a similar command line tool, and type node -v. This should print a version number, so you’ll see something like this v0.10.35

  2. Test NPM
    To see if NPM is installed, type npm -v in a terminal. This should print NPM’s version number so you’ll see something like this 1.4.28.

  3. Create a test file and run it
    A simple way to test that node.js works is to create a JavaScript file.

Create a new file and name it hello.js, and just add the code console.log('Node is installed!');

To run the code simply open your command line program, navigate to the folder where you save the file and type node hello.js.

This will start Node and run the code in the hello.js file. You should see the output Node is installed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment