npm update and upgrade code example Example 1: upgrade npm npm i -g npm-upgrade Example 2: npm update npm install -g npm@latest