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.

npm 8.6, authorization header missing & symlink problem

See original GitHub issue

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 npm@8.6.0, 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 !

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:5
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
nicomeuniercommented, Jun 30, 2022

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

4reactions
joelparkscommented, Apr 8, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm 8.6, authorization header missing & symlink problem
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...
Read more >
Issues · nullivex/nodist - GitHub
Natural node.js and npm version manager for windows. - Issues · nullivex/nodist. ... npm 8.6, authorization header missing & symlink problem.
Read more >
nodist - Bountysource
The OAuth Token in nodist/lib/github.js appears to have expired or been invalidated. As a result new versions of NPM can't be downloaded through...
Read more >
npm-link
First, npm link in a package folder with no arguments will create a symlink in the global folder {prefix}/lib/node_modules/<package> that links to the ......
Read more >
Arbitrary File Creation/Overwrite via insufficient symlink ...
It led to bypassing node-tar symlink checks on directories, ... Fix The problem is addressed in the following ways, when comparing paths in...
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