What exactly does the npm config "node-version" do?

Viewed 152

I mixed up npm config node-version e.g in .npmrc file

// .npmrc
node-version=14.17.0

...with nvm config file i.e. force nvm to use a node version

// .nvmrc
v14.17.0

Which got me wondering - what does node-version do?

node-version

  • Default: Node.js process.version value
  • Type: SemVer string

The node version to use when checking a package's engines setting.

The docs read line its used to compare against the engine field

a. That seems weird

b. Yarn (at least) just checks using the currently active version of node

0 Answers
Related