Skip to content

feat(npm): add install_args option#1581

Merged
williamboman merged 5 commits into
mason-org:mainfrom
amittamari:feat/npm-install-args
Apr 21, 2026
Merged

feat(npm): add install_args option#1581
williamboman merged 5 commits into
mason-org:mainfrom
amittamari:feat/npm-install-args

Conversation

@amittamari
Copy link
Copy Markdown
Contributor

(Rework of #1580)

Often, when I'm working, my npm registry is set to the work's registry, which sometimes causes npm installations in Mason to fail.

To overcome this, I added the option to provide install_args to npm, the same as available in pip, so I can configure Mason to always use the default npm registry.

Note: I wasn't sure if I should also support it in lua/mason-core/managers/npm/init.lua, because I could not find any references where it is used (except tests). Let me know, and I can add it if needed.

@amittamari amittamari force-pushed the feat/npm-install-args branch from ab4c73a to 58ae34d Compare January 7, 2024 13:35
@amittamari
Copy link
Copy Markdown
Contributor Author

Resolved conflicts

@amittamari
Copy link
Copy Markdown
Contributor Author

@williamboman can you please give this one a review? 🙏🏻 It's a relatively small change

* main: (101 commits)
  fix: actually emit the receipt in uninstall event payloads (mason-org#2071)
  chore(main): release 2.2.1 (mason-org#2055)
  fix(registry): exclude synthesized registry when updating/installing registries (mason-org#2054)
  chore(main): release 2.2.0 (mason-org#2032)
  chore(health): remove sh healthcheck (mason-org#2053)
  feat: add support for removal of packages from a registry (mason-org#2052)
  fix(installer): update cwd after uv_fs_rename() was successful (mason-org#2033)
  fix(installer): attempt to recover from known fs error while finalizing installation on some file systems (mason-org#1933)
  chore(main): release 2.1.0 (mason-org#1996)
  fix(spawn): always expand executable path on Windows (mason-org#2021)
  ci: fix shellharden download url (mason-org#2022)
  feat(compiler): make `supported_platforms` a universal source field (mason-org#2002)
  fix(pypi): add support for "compatible release" (~=) PEP440 expressions (mason-org#2000)
  fix(ui): only set border to none if `'winborder'` doesn't exist (mason-org#1984)
  fix(process): close check handles (mason-org#1995)
  chore(main): release 2.0.1 (mason-org#1921)
  fix(spawn): fix locating exepath on Windows systems using a Unix `'shell'` (mason-org#1991)
  fix(fetch): add busybox wget support (mason-org#1829)
  docs: rework Installation & Setup sections, and other minor adjustments (mason-org#1951)
  fix(pypi): pass --no-user flag (mason-org#1958)
  ...
Copy link
Copy Markdown
Member

@williamboman williamboman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, terribly sorry for so late review. I saw this when you first created it but I wanted to avoid exposing this as a setting and find a different .npmrc based approach (I never liked the equivalent pip.install_args setting either as it exposes such tight coupling to implementation details). I think in the absence of another solution this makes sense

@williamboman williamboman merged commit 8fdc4b0 into mason-org:main Apr 21, 2026
10 checks passed
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.

3 participants