npm update to new version code example Example 1: npm update npm update --save Example 2: npm update to latest npm i -g npm@latest