Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法安装 npm #256

Closed
kelegele opened this issue May 26, 2022 · 5 comments
Closed

无法安装 npm #256

kelegele opened this issue May 26, 2022 · 5 comments

Comments

@kelegele
Copy link

PS C:\Users\Felix> nodist npm 8.9.0
npm 8.9.0
{"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.
PS C:\Users\Felix>

@ghost
Copy link

ghost commented Jun 20, 2022

Hi, kelegele :)
This issue is resolved at #246
Please overwrite the files in my repository with your Nodist install location.
Then do npm install and you will be able to download npm. (It is even better to set NODIST_GITHUB_TOKEN as an env variable.

here:nodist-use-octokit-libnpmexec-v4.0.6
名称未設定フaァイル drawio

@ghost
Copy link

ghost commented Jun 20, 2022

#246

Fixed node_modules/semver/semver.js because NPM version check was causing an exception.
image

exports.maxSatisfying = maxSatisfying
function maxSatisfying (versions, range, options) {
  var max = null
  var maxSV = null
  try {
    var rangeObj = new Range(range, options)
  } catch (er) {
    return null
  }
  versions.forEach(function (v) {
    // if (rangeObj.test(v)) { to 
    if (valid(v) && rangeObj.test(v)) {
      // satisfies(v, range, options)
      if (!max || maxSV.compare(v) === -1) {
        // compare(max, v, true)
        max = v
        maxSV = new SemVer(max, options)
      }
    }
  })
  return max
}

Log
名称未設定ファイル drawio

@ghost
Copy link

ghost commented Jun 20, 2022

The npm/node_mdoules that Nodist downloads lacks the necessary dependency packages for npm to work,
so revert to nodist npm global 6.9.0, move to npm/node_modules and do npm install.
This should work.

名称未設定ファイル drawio

@ghost
Copy link

ghost commented Jul 25, 2022

I have created an installer. I hope it will be useful for you.
[wafflook/A node.js and npm version manager(nodist will not die. It will revive)

@Mairu
Copy link
Contributor

Mairu commented Dec 9, 2023

Has been fixed in v.10.3

@Mairu Mairu closed this as completed Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants