Skip to content

Commit

Permalink
Implemented a version check of npm to give a soft tip during the inst…
Browse files Browse the repository at this point in the history
…all procedure

and fixed gitignore
  • Loading branch information
Mo Binni committed Feb 24, 2017
1 parent 67d0d49 commit c5cbee8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode/
node_modules/
build
.DS_Store
Expand Down
15 changes: 15 additions & 0 deletions packages/create-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,21 @@ function createApp(name, verbose, version, template) {
);
console.log();

// Check npm version
var npmVersionProc = spawn.sync('npm', ['--version']),
npmVersion = npmVersionProc.stdout;
if (npmVersion) {
var recommendVersion = semver.lt(npmVersion.toString(), '3.0.0');
if (recommendVersion) {
console.log(
chalk.green(
'Tip: It looks like you are using npm 2.\n' +
'We suggest using npm 3 or Yarn for faster install times and less disk space usage.'
)
);
}
}

var packageJson = {
name: appName,
version: '0.1.0',
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
"optionalDependencies": {
"fsevents": "1.0.17"
}
}
}

0 comments on commit c5cbee8

Please sign in to comment.