mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-09 21:07:46 +00:00
[now-build-utils] Use latest node if no package.json found (#3587)
In a previous release, we pinned the node version to the project so that we could upgrade new projects to a newer version of Node.js while maintaining backwards compatibility with existing projects. This puts some burden on the user when they're deployment is a year old and their pinned version of Node reaches EOL. Because we currently force the user to add a package.json. This PR changes the behavior so projects are no longer pinned. Instead, newer deployments get the latest Node unless they opt-in and pin via package.json.
This commit is contained in:
12
packages/now-build-utils/test/unit.test.js
vendored
12
packages/now-build-utils/test/unit.test.js
vendored
@@ -96,18 +96,6 @@ it('should match all semver ranges', async () => {
|
||||
expect(await getSupportedNodeVersion('^10.5.0')).toHaveProperty('major', 10);
|
||||
});
|
||||
|
||||
it('should select correct node version in getNodeVersion()', async () => {
|
||||
expect(
|
||||
await getNodeVersion('/tmp', undefined, { nodeVersion: '12.x' })
|
||||
).toHaveProperty('major', 12);
|
||||
expect(
|
||||
await getNodeVersion('/tmp', undefined, { nodeVersion: '10.x' })
|
||||
).toHaveProperty('major', 10);
|
||||
expect(
|
||||
await getNodeVersion('/tmp', '10.x', { nodeVersion: '12.x' })
|
||||
).toHaveProperty('major', 10);
|
||||
});
|
||||
|
||||
it('should ignore node version in now dev getNodeVersion()', async () => {
|
||||
expect(
|
||||
await getNodeVersion(
|
||||
|
||||
Reference in New Issue
Block a user