mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(nuxt): don't use app version when verifying nuxt deps (#27864)
This commit is contained in:
parent
9c0f8503da
commit
ac9a95cc1e
@ -307,7 +307,7 @@ async function initNuxt (nuxt: Nuxt) {
|
|||||||
for (const _mod of nuxt.options.modules) {
|
for (const _mod of nuxt.options.modules) {
|
||||||
const mod = Array.isArray(_mod) ? _mod[0] : _mod
|
const mod = Array.isArray(_mod) ? _mod[0] : _mod
|
||||||
if (typeof mod !== 'string') { continue }
|
if (typeof mod !== 'string') { continue }
|
||||||
const modPath = await resolvePath(resolveAlias(mod))
|
const modPath = await resolvePath(resolveAlias(mod), { fallbackToOriginal: true })
|
||||||
specifiedModules.add(modPath)
|
specifiedModules.add(modPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -708,9 +708,9 @@ export async function loadNuxt (opts: LoadNuxtOptions): Promise<Nuxt> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function checkDependencyVersion (name: string, nuxtVersion: string): Promise<void> {
|
async function checkDependencyVersion (name: string, nuxtVersion: string): Promise<void> {
|
||||||
const path = await resolvePath(name).catch(() => null)
|
const path = await resolvePath(name, { fallbackToOriginal: true }).catch(() => null)
|
||||||
|
|
||||||
if (!path) { return }
|
if (!path || path === name) { return }
|
||||||
const { version } = await readPackageJSON(path)
|
const { version } = await readPackageJSON(path)
|
||||||
|
|
||||||
if (version && gt(nuxtVersion, version)) {
|
if (version && gt(nuxtVersion, version)) {
|
||||||
|
@ -56,8 +56,9 @@ describe('dependency mismatch', () => {
|
|||||||
cwd: repoRoot,
|
cwd: repoRoot,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// @nuxt/kit is explicitly installed in repo root but @nuxt/schema isn't, so we only
|
||||||
|
// get warnings about @nuxt/schema
|
||||||
expect(console.warn).toHaveBeenCalledWith(`[nuxt] Expected \`@nuxt/kit\` to be at least \`${version}\` but got \`3.0.0\`. This might lead to unexpected behavior. Check your package.json or refresh your lockfile.`)
|
expect(console.warn).toHaveBeenCalledWith(`[nuxt] Expected \`@nuxt/kit\` to be at least \`${version}\` but got \`3.0.0\`. This might lead to unexpected behavior. Check your package.json or refresh your lockfile.`)
|
||||||
expect(console.warn).toHaveBeenCalledWith(`[nuxt] Expected \`@nuxt/schema\` to be at least \`${version}\` but got \`3.0.0\`. This might lead to unexpected behavior. Check your package.json or refresh your lockfile.`)
|
|
||||||
|
|
||||||
vi.mocked(readPackageJSON).mockRestore()
|
vi.mocked(readPackageJSON).mockRestore()
|
||||||
await nuxt.close()
|
await nuxt.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user