diff --git a/react-native-git-upgrade/cliEntry.js b/react-native-git-upgrade/cliEntry.js index 2145b33a7..42f096c30 100644 --- a/react-native-git-upgrade/cliEntry.js +++ b/react-native-git-upgrade/cliEntry.js @@ -100,7 +100,8 @@ function parseInformationJsonOutput(jsonOutput, requestedVersion) { try { const output = JSON.parse(jsonOutput); const newVersion = output.version; - const newReactVersionRange = output['peerDependencies.react']; + const peerDependencies = output.peerDependencies; + const newReactVersionRange = peerDependencies.react; assert(semver.valid(newVersion)); @@ -258,7 +259,7 @@ async function run(requestedVersion, cliArgs) { checkGitAvailable(); log.info('Get information from NPM registry'); - const viewCommand = 'npm view react-native@' + (requestedVersion || 'latest') + ' peerDependencies.react version --json'; + const viewCommand = 'npm view react-native@' + (requestedVersion || 'latest') + ' --json'; const jsonOutput = await exec(viewCommand, verbose); const {newVersion, newReactVersionRange} = parseInformationJsonOutput(jsonOutput, requestedVersion); // Print which versions we're upgrading to diff --git a/react-native-git-upgrade/package.json b/react-native-git-upgrade/package.json index cb0886112..dd79e8a00 100644 --- a/react-native-git-upgrade/package.json +++ b/react-native-git-upgrade/package.json @@ -1,6 +1,6 @@ { "name": "react-native-git-upgrade", - "version": "0.2.3", + "version": "0.2.4", "license": "BSD-3-Clause", "description": "The React Native upgrade tool", "main": "cli.js", @@ -19,6 +19,7 @@ "babel-preset-es2015-node": "^6.1.1", "babel-preset-stage-3": "^6.17.0", "babel-register": "^6.18.0", + "minimist": "^1.2.0", "npmlog": "^4.0.0", "promise": "^7.1.1", "rimraf": "^2.5.4",