diff --git a/playground/package.json b/playground/package.json index e10c2c2f..f7f47b1a 100644 --- a/playground/package.json +++ b/playground/package.json @@ -7,6 +7,6 @@ "nuxi": "node ../bin/nuxi.mjs" }, "dependencies": { - "nuxt": "latest" + "nuxt": "npm:nuxt-nightly@4.0.0-28826691.eaeda4ee" } } diff --git a/src/commands/upgrade.ts b/src/commands/upgrade.ts index 9562f778..fd72a8ba 100644 --- a/src/commands/upgrade.ts +++ b/src/commands/upgrade.ts @@ -172,6 +172,10 @@ export default defineCommand({ const upgradedVersion = (await getNuxtVersion(cwd)) || '[unknown]' consola.info('Upgraded Nuxt version:', upgradedVersion) + if (upgradedVersion === '[unknown]') { + return + } + if (upgradedVersion === currentVersion) { consola.success('You\'re already using the latest version of Nuxt.') } @@ -182,6 +186,9 @@ export default defineCommand({ 'to', upgradedVersion, ) + if (currentVersion === '[unknown]') { + return + } const commitA = nuxtVersionToGitIdentifier(currentVersion) const commitB = nuxtVersionToGitIdentifier(upgradedVersion) if (commitA && commitB) {