File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/@vue/cli/lib/util Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,10 @@ class PackageManager {
134134
135135 this . needsNpmInstallFix = true
136136 }
137+
138+ if ( semver . gte ( npmVersion , '7.0.0' ) ) {
139+ this . needsPeerDepsFix = true
140+ }
137141 }
138142
139143 if ( ! SUPPORTED_PACKAGE_MANAGERS . includes ( this . bin ) ) {
@@ -374,7 +378,7 @@ class PackageManager {
374378 return
375379 }
376380
377- return await this . runCommand ( 'install' )
381+ return await this . runCommand ( 'install' , this . needsPeerDepsFix ? [ '--legacy-peer-deps' ] : [ ] )
378382 }
379383
380384 async add ( packageName , {
@@ -390,6 +394,10 @@ class PackageManager {
390394 }
391395 }
392396
397+ if ( this . needsPeerDepsFix ) {
398+ args . push ( '--legacy-peer-deps' )
399+ }
400+
393401 return await this . runCommand ( 'add' , [ packageName , ...args ] )
394402 }
395403
You can’t perform that action at this time.
0 commit comments