n4bb12 / verdaccio-github-oauth-ui

📦🔐 GitHub OAuth plugin for Verdaccio
https://verdaccio.org
MIT License
74 stars 45 forks source link

Linux Manjaro: Stuck during login with npx verdaccio-github-oauth-ui at "[github-oauth-ui] Running command: npm config list --json" #196

Open codewing opened 5 months ago

codewing commented 5 months ago

Bug Report

Versions

Version
Verdaccio 5.31.0
This plugin 6.0.8

Environment

Name Version
Browser Firefox / Chrome 125 / 124
Operating system Linux

Observed behavior

Loggin in via the web-interface works but via the console it is stuck at [github-oauth-ui] Running command: npm config list --json

I'm logging in via npx verdaccio-github-oauth-ui --registry https://npm.pkg.holoride.com/

Expected behavior

The command should either produce and error or log me in.

Steps to reproduce

Run the login command without any npm settings (I've deleted ~/.npmrc and the ~/.npm folder)

Additional context

To help in bug hunting this is the verbose output which seems to be successful:

❯ npx -dd verdaccio-github-oauth-ui --registry https://npm.pkg.holoride.com/
npm verbose cli /usr/bin/node /usr/lib/node_modules/npm/bin/npm-cli.js
npm info using npm@10.7.0
npm info using node@v21.7.3
npm verbose title npm exec verdaccio-github-oauth-ui --registry https://npm.pkg.holoride.com/
npm verbose argv "exec" "--loglevel" "verbose" "--" "verdaccio-github-oauth-ui" "--registry" "https://npm.pkg.holoride.com/"
npm verbose logfile logs-max:10 dir:/home/frieder/.npm/_logs/2024-05-21T08_36_55_526Z-
npm verbose logfile /home/frieder/.npm/_logs/2024-05-21T08_36_55_526Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/verdaccio-github-oauth-ui 739ms (cache revalidated)
[github-oauth-ui] Version: verdaccio-github-oauth-ui@6.0.8
[github-oauth-ui] Running command: npm config list --json
npm verbose cli /usr/bin/node /usr/bin/npm
npm info using npm@10.7.0
npm info using node@v21.7.3
npm verbose title npm config list
npm verbose argv "config" "list" "--json"
npm verbose logfile logs-max:10 dir:/home/frieder/.npm/_logs/2024-05-21T08_36_57_201Z-
npm verbose logfile /home/frieder/.npm/_logs/2024-05-21T08_36_57_201Z-debug-0.log
npm verbose exit 0
npm info ok

Edit: It seems that the generated token from the ui doesn't work:

npm error code E401
npm error Unable to authenticate, your authentication token seems to be invalid.
npm error To correct this please try logging in again with:
npm error     npm login
n4bb12 commented 5 months ago

Thanks for reporting.

If successful, the output looks something like this:

[github-oauth-ui] Version: verdaccio-github-oauth-ui@6.0.8
[github-oauth-ui] Running command: npm config list --json
[github-oauth-ui] Running command: npm config set //localhost:4873/:_authToken "foo.bar.baz"
[github-oauth-ui] All done! We've updated your npm configuration.

If you're not seeing this, an error occurred and the process exits with status 1, indicating that there was an error.

The error message is displayed on the web page that opens during the OAuth flow. I made a change to log it as well.

n4bb12 commented 5 months ago

Please comment if this did not resolve your issue.

codewing commented 5 months ago

TLDR: Works with Windows 11 and Ubuntu WSL but doesn't work on my two Manjaro setups.. :(

non verbose log:

[github-oauth-ui] Version: verdaccio-github-oauth-ui@6.0.9
[github-oauth-ui] Running command: npm config list --json
^C

The verbose output indicates that it successfully ran the command:

[github-oauth-ui] Version: verdaccio-github-oauth-ui@6.0.9
[github-oauth-ui] Running command: npm config list --json
npm verbose cli /usr/bin/node /usr/bin/npm
npm info using npm@10.8.0
npm info using node@v20.13.1
npm verbose title npm config list
npm verbose argv "config" "list" "--json"
npm verbose logfile logs-max:10 dir:/home/codewing/.npm/_logs/2024-05-31T09_45_57_242Z-
npm verbose logfile /home/codewing/.npm/_logs/2024-05-31T09_45_57_242Z-debug-0.log
npm verbose cwd /home/codewing
npm verbose os Linux 6.8.11-1-MANJARO
npm verbose node v20.13.1
npm verbose npm  v10.8.0
npm verbose exit 0
npm info ok

so not really sure why it doesn't "exit" the command execution


One more update: I've also just tested it on Windows and there the issue doesn't seem to occur... Additionally I've tested it on windows using ubuntu inside wsl and there the issue also doesn't occur...