npm
npm copied to clipboard
incompatible with pnpm monorepo
I recently converted a monorepo from yarn to pnpm, and now publishing won't happen.
4:36:23 PM] [semantic-release] [@semantic-release/npm] › ℹ Verify authentication for registry https://registry.npmjs.org
[4:36:23 PM] [semantic-release] [@semantic-release/npm] › ℹ Reading npm config from /home/nullvoxpopuli/.npmrc
npm ERR! code ENOWORKSPACES
npm ERR! This command does not support workspaces.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/nullvoxpopuli/.npm/_logs/2022-04-09T20_36_24_000Z-debug-0.log
[4:36:24 PM] [semantic-release] › ✖ Failed step "verifyConditions" of plugin "@semantic-release/npm"
[4:36:24 PM] [semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/github"
I have the same error with npm workspaces. The traceback points at this line: https://github.com/semantic-release/npm/blob/4b33e5bc8e051822aa79654e76bdd82c2f0452cd/lib/verify-auth.js#L21
Also, I can reproduce locally by logging in, moving into one of the workspace of the monorepo and running: npm whoami
The command works fine with [email protected] but not with [email protected]
And it seems to be fixed in [email protected] (assume it was part of https://github.com/npm/cli/pull/4479)
I also have got this error, is there any workaround for this, can we just force the use of [email protected] on the plugin?
Still have this problem with npm 8.19.2:
node@9a0111889c1a: /workspaces/mokr on main [$]
$ cat .npmrc
workspaces = true
node@9a0111889c1a: /workspaces/mokr on main [$]
$ npm -v
8.19.2
node@9a0111889c1a: /workspaces/mokr on main [$]
$ npm whoami
npm ERR! code ENOWORKSPACES
npm ERR! This command does not support workspaces.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/node/.npm/_logs/2022-11-24T10_59_40_560Z-debug-0.log
Opened https://github.com/semantic-release/npm/pull/529 to address this