question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use GitHub Actions to publish npm package error: login required

See original GitHub issue

https://github.com/yisibl/resvg-js/runs/3846453308?check_suite_focus=true

CI: https://github.com/yisibl/resvg-js/blob/d2c05784fe391f6ecdb46dbc129d467a167e239c/.github/workflows/CI.yaml#L455-L500

npm config list
; "user" config from /home/runner/work/_temp/.npmrc

//registry.npmjs.org/:_authToken = (protected) 
always-auth = false 
registry = "https://registry.npmjs.org/" 

; "env" config from environment

userconfig = "/home/runner/work/_temp/.npmrc" 

; node bin location = /opt/hostedtoolcache/node/16.11.0/x64/bin/node
; cwd = /home/runner/work/resvg-js/resvg-js
; HOME = /home/runner
; Run `npm config ls -l` to show all defaults.


2021-10-09T12:13:05.765Z napi:spawn execute npm publish
npm notice 
npm notice 📦  @resvg/resvg-js-win32-x64-msvc@1.0.0
npm notice === Tarball Contents === 
npm notice 104B  README.md                  
npm notice 629B  package.json               
npm notice 2.4MB resvgjs.win32-x64-msvc.node
npm notice === Tarball Details === 
npm notice name:          @resvg/resvg-js-win32-x64-msvc          
npm notice version:       1.0.0                                   
npm notice filename:      @resvg/resvg-js-win32-x64-msvc-1.0.0.tgz
npm notice package size:  1.1 MB                                  
npm notice unpacked size: 2.4 MB                                  
npm notice shasum:        b48d84d0d5b2f26eda9b8b44c443b91e5245f731
npm notice integrity:     sha512-Psq8QC9BQ9WrJ[...]RtniRK8CHon3w==
npm notice total files:   3                                       
npm notice 
npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in.
npm ERR! need auth You need to authorize this machine using `npm adduser`

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2021-10-09T12_13_06_482Z-debug.log
Internal Error: Execution failed with a non-error rejection (rejected value: undefined)
    at Cli2.error (/home/runner/work/resvg-js/resvg-js/node_modules/@napi-rs/cli/scripts/index.js:2173:19)
    at Cli2.run (/home/runner/work/resvg-js/resvg-js/node_modules/@napi-rs/cli/scripts/index.js:1994:37)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm ERR! code 1
npm ERR! path /home/runner/work/resvg-js/resvg-js
npm ERR! command failed
npm ERR! command sh -c napi prepublish -t npm

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2021-10-09T12_13_06_536Z-debug.log
Error: Process completed with exit code 1.

image

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
yisiblcommented, Oct 25, 2021

image

Environments and secrets are very confusing, which caused me to add the npm token to Environments, so it would fail. I suggest GitHub give better documentation and UX on how to add npm tokens here.

0reactions
guxin0123commented, Jul 26, 2022

image

Environments and secrets are very confusing, which caused me to add the npm token to Environments, so it would fail. I suggest GitHub give better documentation and UX on how to add npm tokens here.

I had the same problem, thank you very much for the issues

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with the npm registry - GitHub Docs
To authenticate by logging in to npm, use the npm login command, replacing USERNAME with your GitHub username, TOKEN with your personal access...
Read more >
publishing to npm fails after publishing to GPR #52 - GitHub
Using the CLI I can publish to GPR no problem, but the authentication fails with Actions -- even though the process is nearly...
Read more >
Unable to publish Github package #269
I am trying to setup a workflow that publishes a Github package, but I can't seem to make it work. Here is a...
Read more >
Unable to publish to the GitHub Registry · Issue #130 · actions ...
The problem I'm having is that every time I publish it says I must authenticate, except it's providing a URL related to the...
Read more >
Publishing Node.js packages - GitHub Docs
json file should be @octocat/hello-world . If your npm package uses a scope prefix and the package is public, you need to use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found