Skip to content

Commit ef2cbae

Browse files
yannbertrandhaoqunjiang
authored andcommitted
fix: invalid version error when modules not installed (#4859)
fix #4781
1 parent 2c13800 commit ef2cbae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/@vue/cli/lib/Upgrader.js

+4
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ module.exports = class Upgrader {
201201
const installed = await this.pm.getInstalledVersion(name)
202202
const wanted = await this.pm.getRemoteVersion(name, range)
203203

204+
if (installed === 'N/A') {
205+
throw new Error('At least one dependency is not installed. Please run npm install or yarn before trying to upgrade')
206+
}
207+
204208
let latest = await this.pm.getRemoteVersion(name)
205209
if (includeNext) {
206210
const next = await this.pm.getRemoteVersion(name, 'next')

0 commit comments

Comments
 (0)