nodist icon indicating copy to clipboard operation
nodist copied to clipboard

无法安装 npm

Open kelegele opened this issue 2 years ago • 4 comments

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>

kelegele avatar May 26 '22 14:05 kelegele

Hi, kelegele :) This issue is resolved at https://github.com/nullivex/nodist/pull/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

wafflook avatar Jun 20 '22 07:06 wafflook

https://github.com/nullivex/nodist/pull/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

wafflook avatar Jun 20 '22 07:06 wafflook

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

wafflook avatar Jun 20 '22 12:06 wafflook

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)

wafflook avatar Jul 25 '22 22:07 wafflook

Has been fixed in v.10.3

Mairu avatar Dec 09 '23 08:12 Mairu