get latest version of npm code example
Example 1: update npm
npm install -g npm@latest
Example 2: npm get latest version of package
npm show {pkg} version
Example 3: update npm
npm install -g npm@latest
// for global install
Example 4: npm get version
npm view <package> version