npm install stable version of package code example
Example 1: how to install specific package version npm
$ npm install [email protected]
+ [email protected]
added 48 packages from 36 contributors and audited 121 packages in 2.986s
found 0 vulnerabilities
Example 2: how to install latest version of npm package
//For global packages
npm i -g <package name>@latest
npm i -g express@latest
//For loacal packages
npm outdated
npm update
//Manually updating local packages
npm i <package name>@latest
npm update "react" "react-dom"