npm icon indicating copy to clipboard operation
npm copied to clipboard

incompatible with pnpm monorepo

Open NullVoxPopuli opened this issue 3 years ago • 6 comments

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"

NullVoxPopuli avatar Apr 09 '22 20:04 NullVoxPopuli

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

browniebroke avatar Apr 11 '22 19:04 browniebroke

The command works fine with [email protected] but not with [email protected]

browniebroke avatar Apr 11 '22 19:04 browniebroke

And it seems to be fixed in [email protected] (assume it was part of https://github.com/npm/cli/pull/4479)

browniebroke avatar Apr 11 '22 19:04 browniebroke

I also have got this error, is there any workaround for this, can we just force the use of [email protected] on the plugin?

manast avatar Sep 09 '22 21:09 manast

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

hongaar avatar Nov 24 '22 11:11 hongaar