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

lerna receiving incorrect --registry option (.npmrc isn't merged) #2487

Open
jjenzz opened this issue Jan 18, 2025 · 0 comments
Open

lerna receiving incorrect --registry option (.npmrc isn't merged) #2487

jjenzz opened this issue Jan 18, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@jjenzz
Copy link

jjenzz commented Jan 18, 2025

Describe the bug

i have a project .npmrc file that does not contain the registry. i then use actions/setup-node@v3 in my github actions to specify the registry-url before executing auto shipit. this configures npm by creating a temp global .npmrc file and sets the NPM_CONFIG_USERCONFIG env var with its path. however, this global config is not being merged with my project config when running auto shipit, so lerna does not pickup the registry correctly.

i'm doing this so that i can swap the registry for canary (gh registry) vs production (npm registry) releases during CI. afaik, .npmrc file resolution checks for files at the location in that env var, and merges the global/local configs:

Each of these files is loaded, and config options are resolved in priority order. For example, a setting in the userconfig file would override the setting in the globalconfig file.
https://docs.npmjs.com/cli/v11/configuring-npm/npmrc

given this, i expected the config that auto eventually receives to have the correct registry.

To Reproduce

this is working as expected in one of my projects. the REGISTRY_URL env var is passed to the setup-node workflow in ./.github/actions/setup-repo and publishes correctly.

i copy/pasted that project setup to a new project (with upgraded versions of lerna and auto) but now the same approach does not work:

Image

  • create a project .npmrc file without a registry
  • create a github action that uses actions/setup-node@v3 to point the registry-url to https://npm.pkg.github.com
  • run auto shipit

Expected behavior

the configs would be merged so lerna receives the correct registry

Screenshots

(shown above)

Environment information:

Environment Information:

"auto" version: v11.3.0
"git"  version: v2.39.5 (Apple Git-154)
"node" version: v18.20.4

Project Information:

✔ Repository:      jjenzz/next-client-attr-webpack-plugin (​https://github.com/jjenzz/next-client-attr-webpack-plugin​)
✔ Author Name:     Jenna Smith
✔ Author Email:    [email protected]
✔ Current Version: v0.0.2
✔ Latest Release:  v0.0.2 (​https://github.com/jjenzz/next-client-attr-webpack-plugin/releases/tag/v0.0.2​)

✔ Labels configured on GitHub project 

GitHub Token Information:

✔ Token:            [Token starting with ghp_]
✔ Repo Permission:  admin
✔ User:             jjenzz
✔ API:              undefined (​undefined​)
✔ Enabled Scopes:   repo, write:packages
✔ Rate Limit:       4986/5000

Additional context

N/A

@jjenzz jjenzz added the bug Something isn't working label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant