File tree 1 file changed +9
-1
lines changed
packages/@vue/cli/lib/util
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,10 @@ class PackageManager {
134
134
135
135
this . needsNpmInstallFix = true
136
136
}
137
+
138
+ if ( semver . gte ( npmVersion , '7.0.0' ) ) {
139
+ this . needsPeerDepsFix = true
140
+ }
137
141
}
138
142
139
143
if ( ! SUPPORTED_PACKAGE_MANAGERS . includes ( this . bin ) ) {
@@ -374,7 +378,7 @@ class PackageManager {
374
378
return
375
379
}
376
380
377
- return await this . runCommand ( 'install' )
381
+ return await this . runCommand ( 'install' , this . needsPeerDepsFix ? [ '--legacy-peer-deps' ] : [ ] )
378
382
}
379
383
380
384
async add ( packageName , {
@@ -390,6 +394,10 @@ class PackageManager {
390
394
}
391
395
}
392
396
397
+ if ( this . needsPeerDepsFix ) {
398
+ args . push ( '--legacy-peer-deps' )
399
+ }
400
+
393
401
return await this . runCommand ( 'add' , [ packageName , ...args ] )
394
402
}
395
403
You can’t perform that action at this time.
0 commit comments