node-install-release 0.4.4 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,7 +6,7 @@ var conditionalExtract = require('../conditionalExtract');
|
|
|
6
6
|
|
|
7
7
|
var NODE_DIST_URL = 'https://nodejs.org/dist/index.json';
|
|
8
8
|
var NPM_DIST_URL = 'https://registry.npmjs.org/npm';
|
|
9
|
-
var NPM_MIN_VERSION =
|
|
9
|
+
var NPM_MIN_VERSION = 3;
|
|
10
10
|
|
|
11
11
|
module.exports = function installLib(version, dest, options, callback) {
|
|
12
12
|
var platform = options.platform || process.platform;
|
|
@@ -20,14 +20,14 @@ module.exports = function installLib(version, dest, options, callback) {
|
|
|
20
20
|
var found = releases.find(function (record) {
|
|
21
21
|
return record.version === version.version;
|
|
22
22
|
});
|
|
23
|
-
var
|
|
24
|
-
var
|
|
23
|
+
var npmMajorPair = found && found.npm ? +found.npm.split('.')[0] : NPM_MIN_VERSION;
|
|
24
|
+
var npmMajor = Math.max(npmMajorPair, NPM_MIN_VERSION);
|
|
25
25
|
|
|
26
26
|
get(NPM_DIST_URL).json(function (err, res2) {
|
|
27
27
|
if (err) return callback(err);
|
|
28
28
|
var distTags = res2.body['dist-tags'];
|
|
29
29
|
|
|
30
|
-
var installVersion = distTags['latest-' +
|
|
30
|
+
var installVersion = distTags['latest-' + npmMajor] || distTags.latest;
|
|
31
31
|
var downloadPath = NPM_DIST_URL + '/-/npm-' + installVersion + '.tgz';
|
|
32
32
|
var cachePath = path.join(options.cacheDirectory, path.basename(downloadPath));
|
|
33
33
|
conditionalCache(downloadPath, cachePath, function (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-install-release",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "Cross-platform solution for installing releases of Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"cross-spawn-cb": "^0.6.14",
|
|
37
37
|
"end-with": "^1.0.2",
|
|
38
38
|
"exit": "^0.1.2",
|
|
39
|
-
"fast-extract": "^0.4.
|
|
39
|
+
"fast-extract": "^0.4.6",
|
|
40
40
|
"fs-access-compat": "^1.0.3",
|
|
41
41
|
"function-exec-sync": "^0.2.10",
|
|
42
|
-
"get-remote": "^0.8.
|
|
42
|
+
"get-remote": "^0.8.3",
|
|
43
43
|
"getopts-compat": "^2.2.5",
|
|
44
44
|
"isarray": "^2.0.5",
|
|
45
45
|
"lodash.find": "^4.6.0",
|