fix(plugin): load npm config before Arborist installs#22025
Open
ghost91- wants to merge 2 commits intoanomalyco:devfrom
Open
fix(plugin): load npm config before Arborist installs#22025ghost91- wants to merge 2 commits intoanomalyco:devfrom
ghost91- wants to merge 2 commits intoanomalyco:devfrom
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: I found a potentially related PR: PR #21697: fix(opencode): resolve npmrc with @npmcli/config This PR appears related because it also deals with resolving npm config using |
ghost91-
commented
Apr 11, 2026
|
hello, do you know why everybody failed these two test: e2e(linux) and e2e(windows)? 🤣 |
66f6b63 to
76589e2
Compare
|
Can't wait for this PR to be merged! My opencode has been stuck at version 1.3.13 and I haven't been able to update it for days. |
76589e2 to
95bd891
Compare
j4ng5y
added a commit
to j4ng5y/opencode
that referenced
this pull request
Apr 16, 2026
Load npm config from the active instance/config directory when installing plugin and provider packages so project .npmrc settings and env precedence are preserved for cached installs. Refs anomalyco#21123, anomalyco#21324, anomalyco#21436, anomalyco#21697, anomalyco#22025.
6 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue for this PR
Closes #21123
Type of change
What does this PR do?
This fixes plugin installs from private npm registries.
After the switch to
@npmcli/arborist, OpenCode createdArboristwithout loading npm config first. That caused plugin installs to ignore.npmrcsettings such as scoped registries and fall back toregistry.npmjs.org.This PR loads npm config with
@npmcli/configand passes the flattened result into Arborist.Npm.add()loads config fromGlobal.Path.cache, which preserves the previous cache-local.npmrcbehaviour.Npm.install(dir)loads config fromdir, so local config still works there as well.Related:
registryconfiguration #21079How did you verify your code works?
.npmrc.npmrc.npmrcbun test test/npm/index.test.tsbun test test/config/config.test.tsbun test test/plugin/loader-shared.test.tsbun typecheck.npmrcconfig.Screenshots / recordings
N/A
Checklist