diff --git a/packages/@vue/cli-service/lib/PluginAPI.js b/packages/@vue/cli-service/lib/PluginAPI.js index 66ed0ab0d1..be42a515b5 100644 --- a/packages/@vue/cli-service/lib/PluginAPI.js +++ b/packages/@vue/cli-service/lib/PluginAPI.js @@ -33,7 +33,7 @@ class PluginAPI { throw new Error('Expected string or integer value.') } - if (semver.satisfies(this.version, range)) return + if (semver.satisfies(this.version, range, { includePrerelease: true })) return throw new Error( `Require @vue/cli-service "${range}", but was loaded with "${this.version}".` diff --git a/packages/@vue/cli/lib/GeneratorAPI.js b/packages/@vue/cli/lib/GeneratorAPI.js index 6ae208720d..36cbe1313d 100644 --- a/packages/@vue/cli/lib/GeneratorAPI.js +++ b/packages/@vue/cli/lib/GeneratorAPI.js @@ -90,7 +90,7 @@ class GeneratorAPI { throw new Error('Expected string or integer value.') } - if (semver.satisfies(this.cliVersion, range)) return + if (semver.satisfies(this.cliVersion, range, { includePrerelease: true })) return throw new Error( `Require global @vue/cli "${range}", but was invoked by "${this.cliVersion}".` @@ -124,7 +124,7 @@ class GeneratorAPI { throw new Error('Expected string or integer value.') } - if (semver.satisfies(this.cliServiceVersion, range)) return + if (semver.satisfies(this.cliServiceVersion, range, { includePrerelease: true })) return throw new Error( `Require @vue/cli-service "${range}", but was loaded with "${this.cliServiceVersion}".`