Skip to content

Commit 8d5fbe1

Browse files
committed
acknowledge it won't work on 18.x
1 parent bd2a0eb commit 8d5fbe1

2 files changed

Lines changed: 22 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ same major line. Should you need to upgrade to a new major, use an explicit
306306

307307
- `COREPACK_ENV_FILE` can be set to `0` to request Corepack to not attempt to
308308
load `.corepack.env`; it can be set to a path to specify a different env file.
309+
For Node.js 18.x users, this setting has no effect as that version doesn't
310+
support parsing of `.env` files.
309311

310312
## Troubleshooting
311313

tests/main.test.ts

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ it(`should use hash from env even when "devEngines" defines a different one`, as
314314
});
315315
});
316316

317-
it(`should use hash from env even when ".corepack.env" defines a different one`, async () => {
317+
it(`should use hash from env even when ".corepack.env" defines a different one`, async t => {
318+
// Skip rest of the test on Node.js 18.x as it lacks support for .env files.
319+
if (process.version.startsWith(`v18.`)) t.skip();
320+
318321
await xfs.mktempPromise(async cwd => {
319322
await xfs.writeJsonPromise(ppath.join(cwd, `package.json` as PortablePath), {
320323
devEngines: {
@@ -336,7 +339,10 @@ it(`should use hash from env even when ".corepack.env" defines a different one`,
336339
});
337340

338341
describe(`should accept range in devEngines only if a specific version is provided`, () => {
339-
it(`either in .corepack.env`, async() => {
342+
it(`either in .corepack.env`, async t => {
343+
// Skip rest of the test on Node.js 18.x as it lacks support for .env files.
344+
if (process.version.startsWith(`v18.`)) t.skip();
345+
340346
await xfs.mktempPromise(async cwd => {
341347
await xfs.writeJsonPromise(ppath.join(cwd, `package.json` as PortablePath), {
342348
devEngines: {
@@ -361,7 +367,10 @@ describe(`should accept range in devEngines only if a specific version is provid
361367
});
362368
});
363369
});
364-
it(`either in a different env file specified in env`, async() => {
370+
it(`either in a different env file specified in env`, async t => {
371+
// Skip rest of the test on Node.js 18.x as it lacks support for .env files.
372+
if (process.version.startsWith(`v18.`)) t.skip();
373+
365374
await xfs.mktempPromise(async cwd => {
366375
await xfs.writeJsonPromise(ppath.join(cwd, `package.json` as PortablePath), {
367376
devEngines: {
@@ -445,7 +454,10 @@ describe(`should accept range in devEngines only if a specific version is provid
445454
});
446455
});
447456

448-
it(`Should use version from correct source`, async () => {
457+
it(`Should use version from correct source`, async t => {
458+
// Skip rest of the test on Node.js 18.x as it lacks support for .env files.
459+
if (process.version.startsWith(`v18.`)) t.skip();
460+
449461
await xfs.mktempPromise(async cwd => {
450462
await xfs.writeJsonPromise(ppath.join(cwd, `package.json` as PortablePath), {
451463
devEngines: {
@@ -484,7 +496,10 @@ it(`Should use version from correct source`, async () => {
484496
});
485497

486498
describe(`should reject if range in devEngines does not match version provided`, () => {
487-
it(`in .corepack.env`, async () => {
499+
it(`in .corepack.env`, async t => {
500+
// Skip rest of the test on Node.js 18.x as it lacks support for .env files.
501+
if (process.version.startsWith(`v18.`)) t.skip();
502+
488503
await xfs.mktempPromise(async cwd => {
489504
await xfs.writeJsonPromise(ppath.join(cwd, `package.json` as PortablePath), {
490505
devEngines: {

0 commit comments

Comments
 (0)