.npmrc auth content will be ignored when I supply a .npmrc file local
Description:
When I supply a .npmrc file local, I run npm publish failed with NEEDEDAUTH error. But when I delete the local .npmrc, it will publish success in github action.
The failed github action: https://github.com/whyun-demo/pnpmfile/actions/runs/9395413589
The success github action : https://github.com/whyun-demo/pnpmfile/actions/runs/9395562736/job/25875171087
Action version: actions/setup-node@v4
Platform:
- [x] Ubuntu
- [ ] macOS
- [ ] Windows
Runner type:
- [x] Hosted
- [ ] Self-hosted
Tools version: pnpm 9
Repro steps:
I put a .npmrc file under the root of my project as follows:
registry="https://registry.npmjs.com"
enable-pre-post-scripts=true
And run npm publish in github action.
Expected behavior:
It should publish to npmjs success.
Actual behavior:
Result with NEEDEDAUTH error.
Hello @yunnysunny Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.
Hello @yunnysunny,
The problem you are encountering is due to:
The registry URL in the .npmrc file is incorrect. It should be ""https://registry.npmjs.org"" instead of ""https://registry.npmjs.com"".
Please let us know if this resolves your issue. If the issue persists, please consider sharing a public repository to help diagnose the problem.
Hello @yunnysunny, could you please confirm if the feedback addresses your concern?
@mahabaleshwars Thank you very much, it works ok now.
Hello @yunnysunny,
Thank you for confirming. We will now close this ticket. Please feel free to reach out if you have any other concerns.