@@ -121,21 +121,6 @@ function createApp(name, verbose, version, template) {
121
121
) ;
122
122
console . log ( ) ;
123
123
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
-
139
124
var packageJson = {
140
125
name : appName ,
141
126
version : '0.1.0' ,
@@ -167,6 +152,7 @@ function install(dependencies, verbose, callback) {
167
152
command = 'yarnpkg' ;
168
153
args = [ 'add' , '--exact' ] . concat ( dependencies ) ;
169
154
} else {
155
+ checkNpmVersion ( ) ;
170
156
command = 'npm' ;
171
157
args = [ 'install' , '--save' , '--save-exact' ] . concat ( dependencies ) ;
172
158
}
@@ -245,6 +231,24 @@ function getPackageName(installPackage) {
245
231
return installPackage ;
246
232
}
247
233
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
+
248
252
function checkNodeVersion ( packageName ) {
249
253
var packageJsonPath = path . resolve (
250
254
process . cwd ( ) ,
0 commit comments