-
Notifications
You must be signed in to change notification settings - Fork 642
[rush-lib] Update [dot]npmrc #5296
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
Open
L-Qun
wants to merge
3
commits into
microsoft:main
Choose a base branch
from
L-Qun:patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
common/changes/@microsoft/rush/patch-1_2025-08-05-13-22.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@microsoft/rush", | ||
"comment": "Remove the public NPM registry from the `.npmrc` generated during `rush init`. The public registry is the default, and including it in the repo's default `.npmrc` will override the user's default registry.", | ||
"type": "none" | ||
} | ||
], | ||
"packageName": "@microsoft/rush" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 There was originally some reason why this was needed, maybe for Azure DevOps? I will ask some other maintainers about it at Rush Hour tomorrow.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I think the problem is like this:
1. Person A has no
~/.npmrc
user file on their computer. They runrush update --full
, so thepnpm-lock.yaml
file is created using versions fromregistry=https://registry.npmjs.org/
. Let's say this is the correct behavior.2. Person B is working in some other repository, where they are instructed to configure a private registry in their
~/.npmrc
user file.3. Next, Person B clones the monorepo and runs
rush install
. It mostly works, because the private registry has most of the same packages asnpmjs.org
. But a few versions are missing, maybe because a security policy delays syncing of very new versions.4. Thus, for Person B,
rush install
prints a confusing error about missing versions. Why is it broken?5a. Person B asks for on call support. Person A tries to reproduce the error, but "it works fine for me" (because they are missing the
.npmrc
file).- OR -
5b. Person B "fixes" the problem by running
rush update --full
. Now the lockfile matches their registry. But when they create a pull request, it fails in CI, because the CI machine has no~/.npmrc
user file. What??The core problem is that
rush install
is not behaving deterministically. Ideally there should be no~/.npmrc
at all, but 90% of the common problems can be avoided by explicitly specifyingregistry=
incommon/config/rush/.npmrc
.Of course, having the wrong default in
common/config/rush/.npmrc
will also cause confusion, but that's still better than nondeterministic errors.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@L-Qun The problem you're describing here, it only happens when someone is creating a new monorepo, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@octogonz Creating a new subspace