test-engines-node-version-check

v0.2.0
Tests experience for deprecated Node.js versions in package managers using engines field

test-engines-node-version-check

Tests experience for deprecated Node.js versions in package managers using engines field.

With engines field

Testing with Node.js version v8.11.3

$ node --version
v8.11.3

npm

The package installation succeeds, as engine-strict is not defined.

$ npm --version
5.6.0

$ npm install [email protected]
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 1 package in 0.725s

yarn

The package installation fails.

$ yarn --version
1.22.10

$ yarn add [email protected]
yarn add v1.22.10
info No lockfile found.
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=10.0.0". Got "8.11.3"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

pnpm

The package installation succeeds, as engine-strict is not defined.

$ pnpm --version
3.8.1

$ pnpm add [email protected]
Already up-to-date
Resolving: total 1, reused 0, downloaded 1, done

dependencies:
+ test-engines-node-version-check 0.0.2

With engines field and engine-strict=true in user .npmrc

Testing with Node.js version v8.11.3

$ node --version
v8.11.3

npm

The package installation fails.

$ npm --version
5.6.0

$ npm install [email protected]
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for [email protected]: wanted: {"node":">=10.0.0"} (current: {"node":"8.11.3","npm":"5.6.0"})
npm ERR! notsup Not compatible with your version of node/npm: [email protected]
npm ERR! notsup Not compatible with your version of node/npm: [email protected]
npm ERR! notsup Required: {"node":">=10.0.0"}
npm ERR! notsup Actual:   {"npm":"5.6.0","node":"8.11.3"}

yarn

The package installation fails.

$ yarn --version
1.22.10

$ yarn add [email protected]
yarn add v1.22.10
info No lockfile found.
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=10.0.0". Got "8.11.3"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

pnpm

The package installation fails.

$ pnpm --version
3.8.1

$ pnpm add [email protected]
 ERROR  Your Node version is incompatible with "registry.npmjs.org/test-engines-node-version-check/0.0.2".

Expected version: >=10.0.0
Got: v8.11.3

This is happening because the package's manifest has an engines.node field specified.
To fix this issue, install the required Node version.

With engines field and engineStrict=true

The feature engineStrict was used prior to npm 3.0.0, and it was used to treat this package as if the user had set engine-strict. It is no longer used.

Testing with Node.js version v8.11.3

$ node --version
v8.11.3

npm

The package installation succeeds, as engine-strict is not defined.

$ npm --version
5.6.0

$ npm install [email protected]
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 1 package in 0.796s

yarn

The package installation fails.

$ yarn --version
1.22.10

$ yarn add [email protected]
yarn add v1.22.10
info No lockfile found.
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=10.0.0". Got "8.11.3"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

pnpm

The package installation succeeds, as engine-strict is not defined.

$ pnpm --version
3.8.1

$ pnpm add [email protected]
Already up-to-date
Resolving: total 1, reused 0, downloaded 1, done

dependencies:
+ test-engines-node-version-check 0.1.1

Supported Node.js version v10.24.0

$ node --version
v10.24.0

npm

The package installation succeeds.

$ npm --version
6.14.11

$ npm install [email protected]
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
added 1 package from 1 contributor and audited 1 package in 0.544s
found 0 vulnerabilities

yarn

The package installation succeeds.

$ yarn --version
1.22.10

$ yarn add [email protected]
yarn add v1.22.10
info No lockfile found.
[1/4] πŸ”  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] πŸ”—  Linking dependencies...
[4/4] πŸ”¨  Building fresh packages...

success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ [email protected]
info All dependencies
└─ [email protected]
✨  Done in 0.28s.

pnpm

The package installation succeeds.

$ pnpm --version
5.18.9

$ pnpm add [email protected]
Packages: +1
+
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /Users/trivikr/.pnpm-store/v3
  Virtual store is at:             node_modules/.pnpm
Progress: resolved 1, reused 0, downloaded 1, added 1, done

dependencies:
+ test-engines-node-version-check 0.0.2
npm i test-engines-node-version-check

Metadata

  • MIT
  • >=10.0.0
  • Kamat, Trivikram
  • released 4/8/2021

Downloads

Maintainers