mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 04:22:12 +00:00
[now-build-utils] Fix now dev to use system node (#3509)
This PR will use the system installed version of Node.js and avoid printing a warning or error if a discontinued version is selected. This optimization was already in `@now/node` but for some reason it was never add to `@now/next`. The reason why its relevant today is because the warnings turned into errors due to Node 8 deprecation and we don't have the "Project" in `now dev` so we don't know which version of node to select. So instead of determining the version, `now dev` will always use `node` in the PATH and avoid printing warnings or errors. This also results in less FS reads since we no longer need to read package.json.
This commit is contained in:
11
packages/now-build-utils/test/unit.test.js
vendored
11
packages/now-build-utils/test/unit.test.js
vendored
@@ -104,6 +104,17 @@ it('should select correct node version in getNodeVersion()', async () => {
|
||||
).toHaveProperty('major', 10);
|
||||
});
|
||||
|
||||
it('should ignore node version in now dev getNodeVersion()', async () => {
|
||||
expect(
|
||||
await getNodeVersion(
|
||||
'/tmp',
|
||||
undefined,
|
||||
{ nodeVersion: '1' },
|
||||
{ isDev: true }
|
||||
)
|
||||
).toHaveProperty('runtime', 'nodejs');
|
||||
});
|
||||
|
||||
it('should get latest node version', async () => {
|
||||
expect(await getLatestNodeVersion()).toHaveProperty('major', 12);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user