npm current version code example Example 1: npm version npm install -g npm@latest Example 2: npm get version npm view <package> version