Skip to content

Commit

Permalink
fix: invalid version error when modules not installed (#4859)
Browse files Browse the repository at this point in the history
fix #4781
  • Loading branch information
yannbertrand authored and sodatea committed Nov 26, 2019
1 parent 2c13800 commit ef2cbae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/@vue/cli/lib/Upgrader.js
Expand Up @@ -201,6 +201,10 @@ module.exports = class Upgrader {
const installed = await this.pm.getInstalledVersion(name)
const wanted = await this.pm.getRemoteVersion(name, range)

if (installed === 'N/A') {
throw new Error('At least one dependency is not installed. Please run npm install or yarn before trying to upgrade')
}

let latest = await this.pm.getRemoteVersion(name)
if (includeNext) {
const next = await this.pm.getRemoteVersion(name, 'next')
Expand Down

0 comments on commit ef2cbae

Please sign in to comment.