Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add --no-workspaces to npm whoami #529

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hongaar
Copy link

@hongaar hongaar commented Nov 24, 2022

I'm using semantic-release with a monorepo which is not officially supported but discussed (e.g. semantic-release/semantic-release#1688).

I've tried various alternative but each of them gave me an uncomfortable feeling and after reading through #482 I settled with the seemingly simple option of only using semantic-release together with this .npmrc:

workspaces = true
workspaces-update = false

There's currently one issue blocking me from using this approach. Executing npm whoami with the above .npmrc yields an error, described in #470.

This issue could be resolved by modifying lib/verify-auth.js slightly:

-      const whoamiResult = execa('npm', ['whoami', '--userconfig', npmrc, '--registry', registry], {
+      const whoamiResult = execa('npm', ['whoami', '--userconfig', npmrc, '--registry', registry, '--no-workspaces'], {

The NPM docs mention:

Explicitly setting this to false will cause commands like install to ignore workspaces altogether

I have verified that this flag has no adverse effect, running it on monorepos and non-monorepos both with and without the flag yield the same output.

@DerYeger
Copy link

This would be a welcome change, as I'm also blocked by the current behavior.

@hongaar
Copy link
Author

hongaar commented May 9, 2023

Since I use yarn for all my (mono)repos, I created semantic-release-yarn which supports monorepos natively

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants