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