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

Support reading from $HOME/.npmrc #13990

Merged
merged 16 commits into from
Sep 26, 2024
Merged

Conversation

robertshuford
Copy link
Contributor

@robertshuford robertshuford commented Sep 17, 2024

What does this PR do?

This builds upon the work done in #11979 by adding support for $HOME/.npmrc.
Settings in ./.npmrc will override settings in $HOME/.npmrc.

  • Code changes

How did you verify your code works?

I wrote automated tests

  • I checked the lifetime of memory allocated to verify it's (1) freed and (2) only freed when it should be
  • I included a test for the new code, or an existing test covers it
  • I wrote TypeScript/JavaScript tests and they pass locally (bun-debug test test-file-name.test)

resolves #13764

@robertshuford robertshuford changed the title Support reading from ~/ .npmrc Support reading from $HOME/.npmrc Sep 26, 2024
@chevcast
Copy link

chevcast commented Sep 26, 2024

Can't wait for this to merge. Will make our workflow so much easier since aws codeartifact login --tool npm insists on only generating a .npmrc in the $HOME directory. Devs have to manually move it into the local repo every time.

Copy link
Collaborator

@dylan-conway dylan-conway left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@dylan-conway
Copy link
Collaborator

Tested locally, going to merge

@dylan-conway dylan-conway merged commit 5e97fb8 into oven-sh:main Sep 26, 2024
2 of 3 checks passed
@robertshuford robertshuford deleted the user_npmrc branch September 26, 2024 21:58
@lenovouser
Copy link
Contributor

lenovouser commented Oct 8, 2024

This does not seem to work for me with a global config like this:

@slug:registry=https://my-registry.tld/
//my-registry.tld/:_authToken="<token>"

and a project config like this:

@slug:registry=https://my-registry.tld/

https://my-registry.tld/:always-auth=true

auto-install-peers=true
engine-strict=true
prefer-frozen-lockfile=true
resolution-mode=highest
save-exact=true
save-prefix=''
strict-peer-dependencies=true
update-notifier=true

I am on macOS.

@dylan-conway
Copy link
Collaborator

@lenovouser is it using the wrong registry for the @slug scope? Could you open a new issue?

@lenovouser
Copy link
Contributor

@dylan-conway no, it doesn't use the auth token I believe.

#14433

@VanTigranyan
Copy link

This does not seem to work for me with a global config like this:

@slug:registry=https://my-registry.tld/
//my-registry.tld/:_authToken="<token>"

and a project config like this:

@slug:registry=https://my-registry.tld/

https://my-registry.tld/:always-auth=true

auto-install-peers=true
engine-strict=true
prefer-frozen-lockfile=true
resolution-mode=highest
save-exact=true
save-prefix=''
strict-peer-dependencies=true
update-notifier=true

I am on macOS.

Second this. In my case //my-registry.tld/:_auth="". We use JFrog. I tried many things I even converted npmrc to bunfig.toml, nothing works. Bun basically doesn't work with JFrog.

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.

Bun does not read from $HOME/.npmrc if it exists
5 participants