Replies: 2 comments 3 replies
-
Thanks a ton for your message! I have relayed it internally. |
Beta Was this translation helpful? Give feedback.
-
Vercel already handles this case and invalidates the build cache when the Node.js version changes.
We would have to measure to compare the two because I'm not so sure this is the case. We can't remove |
Beta Was this translation helpful? Give feedback.
-
Currently, the default install command for a next.js project on vercel is to use
npm install
oryarn install
. Besides that, vercel also seems to cachenode_modules
for the build environment. I think this could be improved:~/.npm
(on Posix) instead ofnode_modules
as cachingnode_modules
can break across Node versions and won't work withnpm ci
(see here).npm ci
. I would expect vercel to stick to the recommendations of the upstream package manager. Besides that,npm ci
won't update the lockfile if it's out of sync (which you don't want on CI/CD) and has the potential to be significantly faster.You could say that running
npm i
in an automated environment is maybe not completely horrible. It generally works as expected. However, I don't think there are any reasons to prefernpm i
overnpm ci
in an automated environment.npm ci
was specifically built for use in environments like the vercel deployment environment, so I'd vastly prefer vercel catering to the needs ofnpm ci
in the vercel build environment. Currently however, because vercel cachesnode_modules
and not.npm
, the efficiency ofnpm ci
is hindered, and I think it would be good to resolve that.Beta Was this translation helpful? Give feedback.
All reactions