`use-node-version` not supported

Error: Detected unsupported "use-node-version" in your ".npmrc". Please use "engines" in your "package.json" instead.

I have defined engines but it still requires me to remove use-node-version

Current

it always errors

Expected

Ignore use-node-version and look for engines

Hi @sw-scottwuca, is there any specific reason to keep use-node-version in your .npmrc file? If not, the fastest resolution would be to remove it.

Ya, that’s what I use to manage node versions in dev via pnpm

Hi @sw-scottwuca, I see. You can use engines in the package.json with engine-strict config flag (see .npmrc). For more information, see these docs.

The behaviour isn’t the same. engine-strict limits the node version I can use. But use-node-version automatically sets my node version to the correct one.

Hi @sw-scottwuca, thanks for clarifying that. I’ll share this with our team.

Update:

I spoke to the team and there’s no way around it. You have to remove it for the builds to work correctly.

What is the purpose of this limitation?

In the meantime, I have a workaround by deleting that line during CI

// package.json
{
  scripts: {
    "deploy": "node ../scripts/deleteUseNodeVersion.js && ..."
  }
}

Hi @sw-scottwuca, it’s used internally to ensure our build environment works without being affected by user’s development/local settings.

Glad you found a workaround. Thanks for sharing it here.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.