nodist icon indicating copy to clipboard operation
nodist copied to clipboard

npm 8.6, authorization header missing & symlink problem

Open seb-legat opened this issue 2 years ago • 10 comments

Hello,

I can't install npm 8.6.0, which is the recommanded version by node doctor. When using nodist global npm 8.6 :

npm 8.6
{"message":"Must specify access token via Authorization header.
https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param","documentation_url":"https://docs.github.com/v3/#oauth2-token-sent-in-a-header"}.
Sorry.

I've got no problem with previous versions. The latest installable version is 8.5.5 (match with node 17.8.0).

If I use the official command npm install -g [email protected], it installs but can't be used (npm -v still return 8.5.5).

Another bug : the symlinks created automatically in npmv/8.5.5/nodes-modules were not working on my Windows 10 system, I don't know why. I had to recreate them to have npm working as expected. Same for the ``` arborist ```` symlink in @npmcli.

If you need more infos on the specs of my computer, please ask.

Cheers !

seb-legat avatar Apr 03 '22 15:04 seb-legat

I've returned on my project and I've tried to update npm and I'm receiving something similar:

$>nodist npm latest Unhandled rejection {"message":"Must specify access token via Authorization header. https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param","documentation_url":"https://docs.github.com/v3/#oauth2-token-sent-in-a-header"}

rolivares avatar Apr 07 '22 02:04 rolivares

I had a similar error message starting from scratch with nodist - I typed "nodist add 16" and it installed 11.13.0 and 16.14.2 "nodist npm" and it reported npm 6.9.0 (which doesn't work with node 16) "nodist 16" and it switched to 16 "nodist npm 8.5.5" and it reported {"message":"Must specify access token via Authorization header. https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param","documentation_url":"https://docs.github.com/v3/#oauth2-token-sent-in-a-header"}. Sorry.

(I really like the "Sorry" part ;-)

the workaround I finally learned about was " nodist npm global match " which eventually finished successfully. Now typing "nodist npm" reports 6.9.0 and 8.5.0 with 8.5.0 active.
Now I'm getting what seems to be an unrelated error: "Error: Cannot find module 'libnpmfund'"

Edit: I guess it's not an unrelated error, it seems the install of @npmcli/arborist as part of npm 8.5.0 didn't actually succeed but wasn't reported. Now I don't seem to be able to recover npm 8.5.0 or fix the install.

joelparks avatar Apr 08 '22 15:04 joelparks

I´m having same issue as @joelparks

ccucui avatar Apr 12 '22 13:04 ccucui

Ultimately my workaround was to skip nodist entirely, just use the installer from Node.js to get node v16.14.2 installed with npm 8.6.0 on Win10. Unfortunate that nodist or an nvm alternative doesn't seem to be available for Windows users

joelparks avatar Apr 12 '22 15:04 joelparks

any news about this ?

rolivares avatar May 23 '22 20:05 rolivares

bonjour svp aider mois je n'arrive pas à installer les asset css de breese de laravel9 ,je un systeme ubuntu 20.04 ,xampp,apache server http

jiresmulamba avatar May 29 '22 23:05 jiresmulamba

As a quick fix just after doing nodist npm match|<version>, it's to manually fix the wrong symlinks. Pre-requisite: Windows should be configured in developer mode to avoid administration rights.

nodist npm match
cd C:\Program Files (x86)\Nodist\npmv\8.11.0\node_modules
rm @npmcli\arborist && mklink /D @npmcli\arborist ..\..\workspaces\arborist
rm libnpmaccess  && mklink /D libnpmaccess ..\workspaces\libnpmaccess
rm libnpmdiff    && mklink /D libnpmdiff ..\workspaces\libnpmdiff
rm libnpmexec    && mklink /D libnpmexec ..\workspaces\libnpmexec
rm libnpmfund    && mklink /D libnpmfund ..\workspaces\libnpmfund
rm libnpmhook    && mklink /D libnpmhook ..\workspaces\libnpmhook
rm libnpmorg     && mklink /D libnpmorg ..\workspaces\libnpmorg
rm libnpmpack    && mklink /D libnpmpack ..\workspaces\libnpmpack
rm libnpmpublish && mklink /D libnpmpublish ..\workspaces\libnpmpublish
rm libnpmsearch  && mklink /D libnpmsearch ..\workspaces\libnpmsearch
rm libnpmteam    && mklink /D libnpmteam ..\workspaces\libnpmteam
rm libnpmversion && mklink /D libnpmversion ..\workspaces\libnpmversion

That is because the tar lib used by nodist seems to not create correctly symlink about directories on Windows when extracting https://codeload.github.com/npm/cli/tar.gz/v8.11.0

nicomeunier avatar Jun 30 '22 08:06 nicomeunier

Workaround:

Download NPM CLI version from official repo: https://github.com/npm/cli/tree/v8.6.0

and unpack locally to your C:\Program Files (x86)\Nodist\npmv\8.6.0 folder

db-add2 avatar Jul 20 '22 09:07 db-add2

Yes that will work. Thank you for posting.

I will have a new package out either end of July or beginning of August. Finally, got our new office and need something to break the ice with.

nullivex avatar Jul 20 '22 18:07 nullivex

https://github.com/wafflook/nodistx/ I have created an installer. I hope it will be useful for you. usage

wafflook avatar Jul 25 '22 23:07 wafflook

The workaround doesn't seem to work, and wafflook's installer is no longer available. Any word on this?

I populated C:\Program Files (x86)\Nodist\npmv\9.5.1 with the contents of https://github.com/npm/cli/tree/v9.5.1 and then ran:

nodist npm 9.5.1 npm 9.5.1 {"message":"Must specify access token via Authorization header. https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param","documentation_url":"https://docs.github.com/v3/#oauth2-token-sent-in-a-header"}. Sorry.

Logopher avatar Mar 02 '23 03:03 Logopher

The workaround doesn't seem to work, and wafflook's installer is no longer available. Any word on this?

I populated C:\Program Files (x86)\Nodist\npmv\9.5.1 with the contents of https://github.com/npm/cli/tree/v9.5.1 and then ran:

nodist npm 9.5.1 npm 9.5.1 {"message":"Must specify access token via Authorization header. https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param","documentation_url":"https://docs.github.com/v3/#oauth2-token-sent-in-a-header"}. Sorry.

You have to do essentially what @nicomeunier posted, but with some minor modifications:

  1. run nodist npm match global
  2. open a command prompt (cmd, not powershell) in admin mode and input:
cd C:\Program Files (x86)\Nodist\npmv\9.5.1\node_modules
del @npmcli\arborist && mklink /D @npmcli\arborist ..\..\workspaces\arborist
del @npmcli\config && mklink /D @npmcli\config ..\..\workspaces\config
del libnpmaccess  && mklink /D libnpmaccess ..\workspaces\libnpmaccess
del libnpmdiff    && mklink /D libnpmdiff ..\workspaces\libnpmdiff
del libnpmexec    && mklink /D libnpmexec ..\workspaces\libnpmexec
del libnpmfund    && mklink /D libnpmfund ..\workspaces\libnpmfund
del libnpmhook    && mklink /D libnpmhook ..\workspaces\libnpmhook
del libnpmorg     && mklink /D libnpmorg ..\workspaces\libnpmorg
del libnpmpack    && mklink /D libnpmpack ..\workspaces\libnpmpack
del libnpmpublish && mklink /D libnpmpublish ..\workspaces\libnpmpublish
del libnpmsearch  && mklink /D libnpmsearch ..\workspaces\libnpmsearch
del libnpmteam    && mklink /D libnpmteam ..\workspaces\libnpmteam
del libnpmversion && mklink /D libnpmversion ..\workspaces\libnpmversion

Note using del instead of rm and the new link to config that I guess was added sometime after 8.11.

Derpalus avatar May 08 '23 15:05 Derpalus

The workaround doesn't seem to work, and wafflook's installer is no longer available. Any word on this? I populated C:\Program Files (x86)\Nodist\npmv\9.5.1 with the contents of https://github.com/npm/cli/tree/v9.5.1 and then ran:

nodist npm 9.5.1 npm 9.5.1 {"message":"Must specify access token via Authorization header. https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param","documentation_url":"https://docs.github.com/v3/#oauth2-token-sent-in-a-header"}. Sorry.

You have to do essentially what @nicomeunier posted, but with some minor modifications:

  1. run nodist npm match global
  2. open a command prompt (cmd, not powershell) in admin mode and input:
cd C:\Program Files (x86)\Nodist\npmv\9.5.1\node_modules
del @npmcli\arborist && mklink /D @npmcli\arborist ..\..\workspaces\arborist
del @npmcli\config && mklink /D @npmcli\config ..\..\workspaces\config
del libnpmaccess  && mklink /D libnpmaccess ..\workspaces\libnpmaccess
del libnpmdiff    && mklink /D libnpmdiff ..\workspaces\libnpmdiff
del libnpmexec    && mklink /D libnpmexec ..\workspaces\libnpmexec
del libnpmfund    && mklink /D libnpmfund ..\workspaces\libnpmfund
del libnpmhook    && mklink /D libnpmhook ..\workspaces\libnpmhook
del libnpmorg     && mklink /D libnpmorg ..\workspaces\libnpmorg
del libnpmpack    && mklink /D libnpmpack ..\workspaces\libnpmpack
del libnpmpublish && mklink /D libnpmpublish ..\workspaces\libnpmpublish
del libnpmsearch  && mklink /D libnpmsearch ..\workspaces\libnpmsearch
del libnpmteam    && mklink /D libnpmteam ..\workspaces\libnpmteam
del libnpmversion && mklink /D libnpmversion ..\workspaces\libnpmversion

Note using del instead of rm and the new link to config that I guess was added sometime after 8.11.

This worked for me, thanks to everyone that contributed. It's so annoying that we have to do stuff like this just to get npm working!

saminh avatar May 20 '23 10:05 saminh

Has been fixed in v.10.3

Mairu avatar Dec 09 '23 08:12 Mairu