npm install package globally

Shell
#Syntex
npm install packagename -g

#example
npm install express -g
npm install npm@latest -gnpm install --save-dev package
# example:
npm install --save-dev nodemon#how to install any specific package in nodejs Application
# Syntex
npm install packagename

# example:
npm install express
npm i express

#if you install globally then type 
npm install express -gnpm install package-name -g
Source

Also in Shell: