setup-node icon indicating copy to clipboard operation
setup-node copied to clipboard

.npmrc auth content will be ignored when I supply a .npmrc file local

Open yunnysunny opened this issue 1 year ago • 4 comments

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.

yunnysunny avatar Jun 06 '24 05:06 yunnysunny

Hello @yunnysunny Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.

HarithaVattikuti avatar Jun 07 '24 19:06 HarithaVattikuti

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.

mahabaleshwars avatar Jul 11 '24 14:07 mahabaleshwars

Hello @yunnysunny, could you please confirm if the feedback addresses your concern?

mahabaleshwars avatar Jul 25 '24 07:07 mahabaleshwars

@mahabaleshwars Thank you very much, it works ok now.

yunnysunny avatar Jul 27 '24 13:07 yunnysunny

Hello @yunnysunny,

Thank you for confirming. We will now close this ticket. Please feel free to reach out if you have any other concerns.

mahabaleshwars avatar Jul 31 '24 08:07 mahabaleshwars