src/versions.js
function getAvailableNPMVersions () {
  return new Promise((resolve, reject) => {
    exec('npm view npm versions --json', (err, stdout) => {
      if (err) {
        let error = 'We could not show latest available versions. Try running this script again '
        error += 'with the version you want to install (npm-windows-upgrade --npm-version 3.0.0)'
        return reject(error)
      }

      resolve(JSON.parse(stdout))
    })
  })
}
function getAvailableNPMVersions () {
  return new Promise((resolve, reject) => {
    exec('npm view npm versions --json', (err, stdout) => {
      if (err) {
        let error = 'We could not show latest available versions. Try running this script again '
        error += 'with the version you want to install (npm-windows-upgrade --npm-version 3.0.0)'
        return reject(error)
      }

      resolve(JSON.parse(stdout))
    })
  })
}
function getAvailableNPMVersions ( ) { return new Promise ( ( resolve , reject ) => { exec ( 'npm view npm versions --json' , ( err , stdout ) => { if ( err ) { let error = 'We could not show latest available versions. Try running this script again ' error += 'with the version you want to install (npm-windows-upgrade --npm-version 3.0.0)' return reject ( error ) } resolve ( JSON . parse ( stdout ) ) } ) } ) }
Fetches the published versions of npm from the npm registry
@return {Promise.<versions[]>} - Array of the available versions
Fetches the published versions of npm from the npm registry