-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(nuxi): ensure nuxi upgrade
runs in rootDir
#6707
Conversation
β Deploy Preview for nuxt3-docs canceled.
|
The second So in fact my fix to use the package.json lookup as a fallback should be its own PR
|
It is because of CJS requires cache ( framework/packages/nuxi/src/utils/cjs.ts Line 39 in 6a39155
|
Nice, that worked a treat as far as I can tell
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
nuxi upgrade
runs in rootDir
π Linked issue
β Type of change
π Description
When using
nuxi update
command with a custom path, it won't honour that path when running the package manager install, instead, it will always run in thecwd
.This is apparent in a monorepo or sub-path nuxt installs.
For example, run in this repo
yarn nuxi upgrade ../some-nuxt-app --force
and you'll see it modifies the frameworks package.json and lock.In providing the proper path, a new issue appears where the
getNuxtVersion
fails. It seems like a cache issue where it's resolving to the old version path, leading to a failure to read the file, as it didn't exist.Exception
Logs
As a work-around I've set it up to read from the package.json's dependency, which should be fairly safe.
π Checklist