nodist
nodist copied to clipboard
无法安装 npm
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>
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.
https://github.com/nullivex/nodist/pull/246
Fixed node_modules/semver/semver.js because NPM version check was causing an exception.
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
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.
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)
Has been fixed in v.10.3