install npm from node code example
Example 1: intall npm
npm install -g npm
Example 2: install an npm package
npm install package-name
To save as a dependency:
npm install package-name --save
npm install -g npm
npm install package-name
To save as a dependency:
npm install package-name --save