upgrade npm package to latest version code example Example 1: upgrade npm npm i -g npm-upgrade Example 2: npm update to latest npm i -g npm@latest