npm update and save to package.json code example Example 1: npm update npm update --save Example 2: npm update to latest npm i -g npm@latest