Whenever I invoke a vc command in a repo and Vercel detects an upgrade is available, it alerts me and prompts to upgrade, which of course makes sense.
What I’m confused and frequently frustrated by, is that the upgrade then insists on adding vercel as a dependency to the local package.json I happen to be working in, whether or not it is currently there, as well as correspondingly modifying package-lock.json.
Is this by design? If so, why?
My understanding is that Vercel is intended to installed globally, and adding it as a local dependency just adds a bunch of installation complexity, and would require npx anyway. Even if you wanted to, I don’t understand it’s the default behavior.
If relevant, my npm (and node) are installed and managed by Homebrew.
How are you upgrading it? Are you letting the CLI do it itself? There was one other report in the past few days of vercel adding itself to the package.json but that was upon starting a dev server which shouldn’t be related
Homebrew is a possible culprit, if npm checks its global package directory for vercel and doesn’t find it, it might assume it’s a local package that needs to be installed. If you’re using a built in upgrade feature, can you try installing via npm i -g vercel instead and see if you get the same behavior?
And yes, the upgrade process I’m using is its self-updater, by accepting y when vercel detects an upgrade available, when I invoke just about any vc command while within a project.
So even though my vercel is installed globally with NPM, it keeps adding itself locally within its own upgrade process.