npm install latest version of package.json code example Example: npm get package.json version node -pe "require('./package.json')['version']"