npm install a package code example
Example 1: install npm globally
npm install npm@latest -g
Example 2: install an npm package
npm install package-name
To save as a dependency:
npm install package-name --save
Example 3: download npm package
$ npm install download
Example 4: how to install npm packages
npm i <package>