Skip to content

Having npm as a dependency does not always gurantee that required version of npm is used #1026

@34j

Description

@34j

"npm": "^11.6.2",

npm/lib/publish.js

Lines 23 to 27 in 14c1fc8

const result = execa(
"npm",
["publish", basePath, "--userconfig", npmrc, "--tag", distTag, "--registry", registry],
{ cwd, env, preferLocal: true }
);

Since npm publish is executed via execa, if @semantic-release/npm is not installed via npx, the npm installed as a dependency may not necessarily be used as described in: semantic-release/semantic-release#3913 semantic-release/semantic-release#3920. Therefore, I suggest checking the npm version at runtime.

I see you have semantic-release and plugins under devDependencies and installing with pnpm, which might be complicating things. Please try removing from devDependencies and just use npx to both install and run

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions