@@ -121,21 +121,6 @@ function createApp(name, verbose, version, template) {
121121 ) ;
122122 console . log ( ) ;
123123
124- // Check npm version
125- var npmVersionProc = spawn . sync ( 'npm' , [ '--version' ] ) ,
126- npmVersion = npmVersionProc . stdout ;
127- if ( npmVersion ) {
128- var recommendVersion = semver . lt ( npmVersion . toString ( ) , '3.0.0' ) ;
129- if ( recommendVersion ) {
130- console . log (
131- chalk . green (
132- 'Tip: It looks like you are using npm 2.\n' +
133- 'We suggest using npm 3 or Yarn for faster install times and less disk space usage.'
134- )
135- ) ;
136- }
137- }
138-
139124 var packageJson = {
140125 name : appName ,
141126 version : '0.1.0' ,
@@ -167,6 +152,7 @@ function install(dependencies, verbose, callback) {
167152 command = 'yarnpkg' ;
168153 args = [ 'add' , '--exact' ] . concat ( dependencies ) ;
169154 } else {
155+ checkNpmVersion ( ) ;
170156 command = 'npm' ;
171157 args = [ 'install' , '--save' , '--save-exact' ] . concat ( dependencies ) ;
172158 }
@@ -245,6 +231,24 @@ function getPackageName(installPackage) {
245231 return installPackage ;
246232}
247233
234+ function checkNpmVersion ( ) {
235+ // Check npm version
236+ var npmVersionProc = spawn . sync ( 'npm' , [ '--version' ] ) ,
237+ npmVersion = npmVersionProc . stdout ;
238+
239+ if ( npmVersion ) {
240+ var recommendVersion = semver . lt ( npmVersion . toString ( ) , '3.0.0' ) ;
241+ if ( recommendVersion ) {
242+ console . log (
243+ chalk . green (
244+ 'Tip: It looks like you are using npm 2.\n' +
245+ 'We suggest using npm 3 or Yarn for faster install times and less disk space usage.'
246+ )
247+ ) ;
248+ }
249+ }
250+ }
251+
248252function checkNodeVersion ( packageName ) {
249253 var packageJsonPath = path . resolve (
250254 process . cwd ( ) ,
0 commit comments