Skip to content

Commit

Permalink
Made react installed via reac-native init strict to unbreak 15.1.0
Browse files Browse the repository at this point in the history
Summary:
[email protected] is incompatible with [email protected].
This PR was cherry-picked to 0.26-stable branch now.

What this change does:
- react-native-cli (major release bump) saves exact versions of react-native and react (only in npm2) dependencies into package.json
- local-cli saves exact version of react (only npm3) dependency into package.json
Closes facebook/react-native#7879

Differential Revision: D3384705

Pulled By: davidaurelio

fbshipit-source-id: d4dff418f9659bd083ae8826433a4e7c0355d03b
  • Loading branch information
bestander authored and Facebook Github Bot 6 committed Jun 3, 2016
1 parent c13a769 commit 26166d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ function getInstallPackage(rnPackage) {
}

function run(root, projectName, rnPackage) {
exec('npm install --save ' + getInstallPackage(rnPackage), function(e, stdout, stderr) {
exec('npm install --save --save-exact ' + getInstallPackage(rnPackage), function(e, stdout, stderr) {
if (e) {
console.log(stdout);
console.error(stderr);
console.error('`npm install --save react-native` failed');
console.error('`npm install --save --save-exact react-native` failed');
process.exit(1);
}

Expand All @@ -229,10 +229,10 @@ function run(root, projectName, rnPackage) {
}

function runVerbose(root, projectName, rnPackage) {
var proc = spawn('npm', ['install', '--verbose', '--save', getInstallPackage(rnPackage)], {stdio: 'inherit'});
var proc = spawn('npm', ['install', '--verbose', '--save', '--save-exact', getInstallPackage(rnPackage)], {stdio: 'inherit'});
proc.on('close', function (code) {
if (code !== 0) {
console.error('`npm install --save react-native` failed');
console.error('`npm install --save --save-exact react-native` failed');
return;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-cli",
"version": "0.2.0",
"version": "1.0.0",
"license": "BSD-3-Clause",
"description": "The React Native CLI tools",
"main": "index.js",
Expand Down

0 comments on commit 26166d7

Please sign in to comment.