Contents

Install Node package manager (NPM)

Esay NodeJS setup in Unix-like systems (Linux / MacOS).

Note for windows users

Just download and install NodeJS directly or through Chocolatey package manager.

Why use NVM ?

Benefits of using Node Version manager (NVM):

  • Avoid conflicts between system npm and what your project needs.
  • Permission with global installtion: nvm allows regular user previledge to install npm packages (npm i hexo-cli -g) ‘globally’.

Installation

1
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash

✒️ For zsh users, you could install the zsh-nvm module.

Check your installation afterwards:

1
nvm --version

Usage

Install NodeJS LTS version along with npm.

1
nvm install --lts

A local version of NodeJS will be available.

1
node -v

And then you can install packages globally without sudo command. For example,

1
npm install -g hexo-cli docsify-cli