node-install-release 1.16.1 → 1.16.2

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.
@@ -84,80 +84,72 @@ function install(versionExpression, options, callback) {
84
84
  }
85
85
  var version = versions[0];
86
86
  var result = (0, _createResultts.default)(options, version);
87
- // Fast path: check if installation is complete
88
- (0, _checkMissingts.default)(result.installPath, options, function(err, missing) {
89
- if (err) {
90
- callback(err);
91
- return;
92
- }
93
- // Early exit if both node and npm are already present
94
- if (!missing.length) {
87
+ // Fast path: with atomic installs, folder exists = complete installation
88
+ _fs.default.stat(result.installPath, function(err) {
89
+ if (!err) {
95
90
  callback(null, result);
96
91
  return;
97
92
  }
98
- // Something is missing - use atomic pattern with temp folder
99
- // First, remove any partial installation to avoid conflicts
100
- (0, _fsremovecompat.safeRm)(result.installPath, function() {
101
- var tempPath = (0, _tempsuffix.default)(result.installPath);
102
- var queue = new _queuecb.default(1);
103
- queue.defer(_mkdirpclassic.default.bind(null, options.cachePath));
104
- queue.defer(_ensureDestinationParentts.default.bind(null, tempPath));
105
- // Install node to temp folder
106
- queue.defer(_indexts.default.bind(null, version, tempPath, options));
107
- // Check and install npm to temp folder
108
- // Skip npm download only if bundled npm is modern (>= 3)
109
- queue.defer(function(cb) {
110
- (0, _checkMissingts.default)(tempPath, options, function(err, npmMissing) {
111
- if (err) {
112
- cb(err);
113
- return;
114
- }
115
- if (!~npmMissing.indexOf('npm')) {
116
- // npm is present (bundled with node) - check if it's modern enough to keep
117
- var dist = (0, _nodefilenametodistpaths.getDist)(version);
118
- var bundledNpmMajor = dist && dist.npm ? +dist.npm.split('.')[0] : 0;
119
- if (bundledNpmMajor >= 3) {
120
- cb(); // npm >= 3 bundled, skip download
121
- return;
122
- }
123
- // old npm (<3) is buggy - delete it so installNPM can override
124
- var platform = options.platform;
125
- var libPath = platform === 'win32' ? tempPath : _path.default.join(tempPath, 'lib');
126
- var npmPath = _path.default.join(libPath, 'node_modules', 'npm');
127
- (0, _fsremovecompat.safeRm)(npmPath, function() {
128
- return (0, _indexts1.default)(version, tempPath, options, cb);
129
- });
130
- return;
131
- }
132
- (0, _indexts1.default)(version, tempPath, options, cb);
133
- });
134
- });
135
- // Atomic rename: move temp folder to final destination
136
- queue.defer(function(cb) {
137
- _fs.default.rename(tempPath, result.installPath, function(err) {
138
- if (!err) return cb();
139
- // Race condition: another process may have already created dest
140
- if (err.code === 'EEXIST' || err.code === 'ENOTEMPTY' || err.code === 'EPERM') {
141
- // Another process won the race - clean up temp and succeed
142
- (0, _fsremovecompat.safeRm)(tempPath, function() {
143
- return cb();
144
- });
93
+ // Folder doesn't exist - do atomic install with temp folder
94
+ var tempPath = (0, _tempsuffix.default)(result.installPath);
95
+ var queue = new _queuecb.default(1);
96
+ queue.defer(_mkdirpclassic.default.bind(null, options.cachePath));
97
+ queue.defer(_ensureDestinationParentts.default.bind(null, tempPath));
98
+ // Install node to temp folder
99
+ queue.defer(_indexts.default.bind(null, version, tempPath, options));
100
+ // Check and install npm to temp folder
101
+ // Skip npm download only if bundled npm is modern (>= 3)
102
+ queue.defer(function(cb) {
103
+ (0, _checkMissingts.default)(tempPath, options, function(err, npmMissing) {
104
+ if (err) {
105
+ cb(err);
106
+ return;
107
+ }
108
+ if (!~npmMissing.indexOf('npm')) {
109
+ // npm is present (bundled with node) - check if it's modern enough to keep
110
+ var dist = (0, _nodefilenametodistpaths.getDist)(version);
111
+ var bundledNpmMajor = dist && dist.npm ? +dist.npm.split('.')[0] : 0;
112
+ if (bundledNpmMajor >= 3) {
113
+ cb(); // npm >= 3 bundled, skip download
145
114
  return;
146
115
  }
147
- cb(err);
148
- });
116
+ // old npm (<3) is buggy - delete it so installNPM can override
117
+ var platform = options.platform;
118
+ var libPath = platform === 'win32' ? tempPath : _path.default.join(tempPath, 'lib');
119
+ var npmPath = _path.default.join(libPath, 'node_modules', 'npm');
120
+ (0, _fsremovecompat.safeRm)(npmPath, function() {
121
+ return (0, _indexts1.default)(version, tempPath, options, cb);
122
+ });
123
+ return;
124
+ }
125
+ (0, _indexts1.default)(version, tempPath, options, cb);
149
126
  });
150
- queue.await(function(err) {
151
- if (err) {
152
- // Clean up temp folder on error
127
+ });
128
+ // Atomic rename: move temp folder to final destination
129
+ queue.defer(function(cb) {
130
+ _fs.default.rename(tempPath, result.installPath, function(err) {
131
+ if (!err) return cb();
132
+ // Race condition: another process may have already created dest
133
+ if (err.code === 'EEXIST' || err.code === 'ENOTEMPTY' || err.code === 'EPERM') {
134
+ // Another process won the race - clean up temp and succeed
153
135
  (0, _fsremovecompat.safeRm)(tempPath, function() {
154
- return callback(err);
136
+ return cb();
155
137
  });
156
138
  return;
157
139
  }
158
- callback(null, result);
140
+ cb(err);
159
141
  });
160
142
  });
143
+ queue.await(function(err) {
144
+ if (err) {
145
+ // Clean up temp folder on error
146
+ (0, _fsremovecompat.safeRm)(tempPath, function() {
147
+ return callback(err);
148
+ });
149
+ return;
150
+ }
151
+ callback(null, result);
152
+ });
161
153
  });
162
154
  });
163
155
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/workers/install.ts"],"sourcesContent":["import fs from 'fs';\nimport { safeRm } from 'fs-remove-compat';\nimport isVersion from 'is-version';\nimport mkdirp from 'mkdirp-classic';\nimport { getDist } from 'node-filename-to-dist-paths';\nimport resolveVersions from 'node-resolve-versions';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport tempSuffix from 'temp-suffix';\n\nimport { DEFAULT_STORAGE_PATHS } from '../constants.ts';\n\nimport createResult from '../createResult.ts';\nimport createStoragePaths from '../createStoragePaths.ts';\nimport installNode from '../installNode/index.ts';\n\nimport installNPM from '../installNPM/index.ts';\nimport checkMissing from '../lib/checkMissing.ts';\nimport ensureDestinationParent from '../lib/ensureDestinationParent.ts';\nimport getTarget from '../lib/getTarget.ts';\n\nimport type { InstallCallback, InstallOptions } from '../types.ts';\n\ntype GetVersionsCallback = (error?: Error, results?: string[]) => undefined;\nfunction getVersions(versionExpression: string, options: InstallOptions, callback: GetVersionsCallback): undefined {\n // short circuit\n isVersion(versionExpression) ? callback(null, [versionExpression]) : resolveVersions(versionExpression, options, callback);\n}\n\nexport default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): undefined {\n const storagePaths = options.storagePath ? createStoragePaths(options.storagePath) : DEFAULT_STORAGE_PATHS;\n options = { ...storagePaths, ...options, ...getTarget(options) };\n getVersions(versionExpression, options, (err?: Error, versions?: string[]): undefined => {\n if (err) {\n callback(err);\n return;\n }\n if (!versions.length) {\n callback(new Error(`Could not resolve versions for: ${versionExpression}`));\n return;\n }\n if (versions.length !== 1) {\n callback(new Error(`Version ${versionExpression} resolved to multiple versions: ${versions.map((x) => x)}. Expecting one.`));\n return;\n }\n\n const version = versions[0];\n const result = createResult(options, version);\n\n // Fast path: check if installation is complete\n checkMissing(result.installPath, options, (err, missing): undefined => {\n if (err) {\n callback(err);\n return;\n }\n\n // Early exit if both node and npm are already present\n if (!missing.length) {\n callback(null, result);\n return;\n }\n\n // Something is missing - use atomic pattern with temp folder\n // First, remove any partial installation to avoid conflicts\n safeRm(result.installPath, () => {\n const tempPath = tempSuffix(result.installPath);\n\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, options.cachePath));\n queue.defer(ensureDestinationParent.bind(null, tempPath));\n\n // Install node to temp folder\n queue.defer(installNode.bind(null, version, tempPath, options));\n\n // Check and install npm to temp folder\n // Skip npm download only if bundled npm is modern (>= 3)\n queue.defer((cb) => {\n checkMissing(tempPath, options, (err, npmMissing): undefined => {\n if (err) {\n cb(err);\n return;\n }\n if (!~npmMissing.indexOf('npm')) {\n // npm is present (bundled with node) - check if it's modern enough to keep\n const dist = getDist(version);\n const bundledNpmMajor = dist && dist.npm ? +dist.npm.split('.')[0] : 0;\n if (bundledNpmMajor >= 3) {\n cb(); // npm >= 3 bundled, skip download\n return;\n }\n // old npm (<3) is buggy - delete it so installNPM can override\n const platform = options.platform;\n const libPath = platform === 'win32' ? tempPath : path.join(tempPath, 'lib');\n const npmPath = path.join(libPath, 'node_modules', 'npm');\n safeRm(npmPath, () => installNPM(version, tempPath, options, cb));\n return;\n }\n installNPM(version, tempPath, options, cb);\n });\n });\n\n // Atomic rename: move temp folder to final destination\n queue.defer((cb) => {\n fs.rename(tempPath, result.installPath, (err) => {\n if (!err) return cb();\n // Race condition: another process may have already created dest\n if (err.code === 'EEXIST' || err.code === 'ENOTEMPTY' || err.code === 'EPERM') {\n // Another process won the race - clean up temp and succeed\n safeRm(tempPath, () => cb());\n return;\n }\n cb(err);\n });\n });\n\n queue.await((err) => {\n if (err) {\n // Clean up temp folder on error\n safeRm(tempPath, () => callback(err));\n return;\n }\n callback(null, result);\n });\n });\n });\n });\n}\n"],"names":["install","getVersions","versionExpression","options","callback","isVersion","resolveVersions","storagePaths","storagePath","createStoragePaths","DEFAULT_STORAGE_PATHS","getTarget","err","versions","length","Error","map","x","version","result","createResult","checkMissing","installPath","missing","safeRm","tempPath","tempSuffix","queue","Queue","defer","mkdirp","bind","cachePath","ensureDestinationParent","installNode","cb","npmMissing","indexOf","dist","getDist","bundledNpmMajor","npm","split","platform","libPath","path","join","npmPath","installNPM","fs","rename","code","await"],"mappings":";;;;+BA6BA;;;eAAwBA;;;yDA7BT;8BACQ;gEACD;oEACH;uCACK;0EACI;2DACX;8DACC;iEACK;2BAEe;qEAEb;2EACM;8DACP;+DAED;qEACE;gFACW;kEACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKtB,SAASC,YAAYC,iBAAyB,EAAEC,OAAuB,EAAEC,QAA6B;IACpG,gBAAgB;IAChBC,IAAAA,kBAAS,EAACH,qBAAqBE,SAAS,MAAM;QAACF;KAAkB,IAAII,IAAAA,4BAAe,EAACJ,mBAAmBC,SAASC;AACnH;AAEe,SAASJ,QAAQE,iBAAyB,EAAEC,OAAuB,EAAEC,QAAyB;IAC3G,IAAMG,eAAeJ,QAAQK,WAAW,GAAGC,IAAAA,6BAAkB,EAAC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BACF;oBACAR,SAAS,MAAMe;gBACjB;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/workers/install.ts"],"sourcesContent":["import fs from 'fs';\nimport { safeRm } from 'fs-remove-compat';\nimport isVersion from 'is-version';\nimport mkdirp from 'mkdirp-classic';\nimport { getDist } from 'node-filename-to-dist-paths';\nimport resolveVersions from 'node-resolve-versions';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport tempSuffix from 'temp-suffix';\n\nimport { DEFAULT_STORAGE_PATHS } from '../constants.ts';\n\nimport createResult from '../createResult.ts';\nimport createStoragePaths from '../createStoragePaths.ts';\nimport installNode from '../installNode/index.ts';\n\nimport installNPM from '../installNPM/index.ts';\nimport checkMissing from '../lib/checkMissing.ts';\nimport ensureDestinationParent from '../lib/ensureDestinationParent.ts';\nimport getTarget from '../lib/getTarget.ts';\n\nimport type { InstallCallback, InstallOptions } from '../types.ts';\n\ntype GetVersionsCallback = (error?: Error, results?: string[]) => undefined;\nfunction getVersions(versionExpression: string, options: InstallOptions, callback: GetVersionsCallback): undefined {\n // short circuit\n isVersion(versionExpression) ? callback(null, [versionExpression]) : resolveVersions(versionExpression, options, callback);\n}\n\nexport default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): undefined {\n const storagePaths = options.storagePath ? createStoragePaths(options.storagePath) : DEFAULT_STORAGE_PATHS;\n options = { ...storagePaths, ...options, ...getTarget(options) };\n getVersions(versionExpression, options, (err?: Error, versions?: string[]): undefined => {\n if (err) {\n callback(err);\n return;\n }\n if (!versions.length) {\n callback(new Error(`Could not resolve versions for: ${versionExpression}`));\n return;\n }\n if (versions.length !== 1) {\n callback(new Error(`Version ${versionExpression} resolved to multiple versions: ${versions.map((x) => x)}. Expecting one.`));\n return;\n }\n\n const version = versions[0];\n const result = createResult(options, version);\n\n // Fast path: with atomic installs, folder exists = complete installation\n fs.stat(result.installPath, (err) => {\n if (!err) {\n callback(null, result);\n return;\n }\n\n // Folder doesn't exist - do atomic install with temp folder\n const tempPath = tempSuffix(result.installPath);\n\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, options.cachePath));\n queue.defer(ensureDestinationParent.bind(null, tempPath));\n\n // Install node to temp folder\n queue.defer(installNode.bind(null, version, tempPath, options));\n\n // Check and install npm to temp folder\n // Skip npm download only if bundled npm is modern (>= 3)\n queue.defer((cb) => {\n checkMissing(tempPath, options, (err, npmMissing): undefined => {\n if (err) {\n cb(err);\n return;\n }\n if (!~npmMissing.indexOf('npm')) {\n // npm is present (bundled with node) - check if it's modern enough to keep\n const dist = getDist(version);\n const bundledNpmMajor = dist && dist.npm ? +dist.npm.split('.')[0] : 0;\n if (bundledNpmMajor >= 3) {\n cb(); // npm >= 3 bundled, skip download\n return;\n }\n // old npm (<3) is buggy - delete it so installNPM can override\n const platform = options.platform;\n const libPath = platform === 'win32' ? tempPath : path.join(tempPath, 'lib');\n const npmPath = path.join(libPath, 'node_modules', 'npm');\n safeRm(npmPath, () => installNPM(version, tempPath, options, cb));\n return;\n }\n installNPM(version, tempPath, options, cb);\n });\n });\n\n // Atomic rename: move temp folder to final destination\n queue.defer((cb) => {\n fs.rename(tempPath, result.installPath, (err) => {\n if (!err) return cb();\n // Race condition: another process may have already created dest\n if (err.code === 'EEXIST' || err.code === 'ENOTEMPTY' || err.code === 'EPERM') {\n // Another process won the race - clean up temp and succeed\n safeRm(tempPath, () => cb());\n return;\n }\n cb(err);\n });\n });\n\n queue.await((err) => {\n if (err) {\n // Clean up temp folder on error\n safeRm(tempPath, () => callback(err));\n return;\n }\n callback(null, result);\n });\n });\n });\n}\n"],"names":["install","getVersions","versionExpression","options","callback","isVersion","resolveVersions","storagePaths","storagePath","createStoragePaths","DEFAULT_STORAGE_PATHS","getTarget","err","versions","length","Error","map","x","version","result","createResult","fs","stat","installPath","tempPath","tempSuffix","queue","Queue","defer","mkdirp","bind","cachePath","ensureDestinationParent","installNode","cb","checkMissing","npmMissing","indexOf","dist","getDist","bundledNpmMajor","npm","split","platform","libPath","path","join","npmPath","safeRm","installNPM","rename","code","await"],"mappings":";;;;+BA6BA;;;eAAwBA;;;yDA7BT;8BACQ;gEACD;oEACH;uCACK;0EACI;2DACX;8DACC;iEACK;2BAEe;qEAEb;2EACM;8DACP;+DAED;qEACE;gFACW;kEACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKtB,SAASC,YAAYC,iBAAyB,EAAEC,OAAuB,EAAEC,QAA6B;IACpG,gBAAgB;IAChBC,IAAAA,kBAAS,EAACH,qBAAqBE,SAAS,MAAM;QAACF;KAAkB,IAAII,IAAAA,4BAAe,EAACJ,mBAAmBC,SAASC;AACnH;AAEe,SAASJ,QAAQE,iBAAyB,EAAEC,OAAuB,EAAEC,QAAyB;IAC3G,IAAMG,eAAeJ,QAAQK,WAAW,GAAGC,IAAAA,6BAAkB,EAACN,QAAQK,WAAW,IAAIE,kCAAqB;IAC1GP,UAAU,mBAAKI,cAAiBJ,SAAYQ,IAAAA,oBAAS,EAACR;IACtDF,YAAYC,mBAAmBC,SAAS,SAACS,KAAaC;QACpD,IAAID,KAAK;YACPR,SAASQ;YACT;QACF;QACA,IAAI,CAACC,SAASC,MAAM,EAAE;YACpBV,SAAS,IAAIW,MAAM,AAAC,mCAAoD,OAAlBb;YACtD;QACF;QACA,IAAIW,SAASC,MAAM,KAAK,GAAG;YACzBV,SAAS,IAAIW,MAAM,AAAC,WAA8DF,OAApDX,mBAAkB,oCAAyD,OAAvBW,SAASG,GAAG,CAAC,SAACC;uBAAMA;gBAAG;YACzG;QACF;QAEA,IAAMC,UAAUL,QAAQ,CAAC,EAAE;QAC3B,IAAMM,SAASC,IAAAA,uBAAY,EAACjB,SAASe;QAErC,yEAAyE;QACzEG,WAAE,CAACC,IAAI,CAACH,OAAOI,WAAW,EAAE,SAACX;YAC3B,IAAI,CAACA,KAAK;gBACRR,SAAS,MAAMe;gBACf;YACF;YAEA,4DAA4D;YAC5D,IAAMK,WAAWC,IAAAA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ACvC,IAAI,CAACA,KAAK,OAAOsB;oBACjB,gEAAgE;oBAChE,IAAItB,IAAIuC,IAAI,KAAK,YAAYvC,IAAIuC,IAAI,KAAK,eAAevC,IAAIuC,IAAI,KAAK,SAAS;wBAC7E,2DAA2D;wBAC3DH,IAAAA,sBAAM,EAACxB,UAAU;mCAAMU;;wBACvB;oBACF;oBACAA,GAAGtB;gBACL;YACF;YAEAc,MAAM0B,KAAK,CAAC,SAACxC;gBACX,IAAIA,KAAK;oBACP,gCAAgC;oBAChCoC,IAAAA,sBAAM,EAACxB,UAAU;+BAAMpB,SAASQ;;oBAChC;gBACF;gBACAR,SAAS,MAAMe;YACjB;QACF;IACF;AACF"}
@@ -43,74 +43,66 @@ export default function install(versionExpression, options, callback) {
43
43
  }
44
44
  const version = versions[0];
45
45
  const result = createResult(options, version);
46
- // Fast path: check if installation is complete
47
- checkMissing(result.installPath, options, (err, missing)=>{
48
- if (err) {
49
- callback(err);
50
- return;
51
- }
52
- // Early exit if both node and npm are already present
53
- if (!missing.length) {
46
+ // Fast path: with atomic installs, folder exists = complete installation
47
+ fs.stat(result.installPath, (err)=>{
48
+ if (!err) {
54
49
  callback(null, result);
55
50
  return;
56
51
  }
57
- // Something is missing - use atomic pattern with temp folder
58
- // First, remove any partial installation to avoid conflicts
59
- safeRm(result.installPath, ()=>{
60
- const tempPath = tempSuffix(result.installPath);
61
- const queue = new Queue(1);
62
- queue.defer(mkdirp.bind(null, options.cachePath));
63
- queue.defer(ensureDestinationParent.bind(null, tempPath));
64
- // Install node to temp folder
65
- queue.defer(installNode.bind(null, version, tempPath, options));
66
- // Check and install npm to temp folder
67
- // Skip npm download only if bundled npm is modern (>= 3)
68
- queue.defer((cb)=>{
69
- checkMissing(tempPath, options, (err, npmMissing)=>{
70
- if (err) {
71
- cb(err);
72
- return;
73
- }
74
- if (!~npmMissing.indexOf('npm')) {
75
- // npm is present (bundled with node) - check if it's modern enough to keep
76
- const dist = getDist(version);
77
- const bundledNpmMajor = dist && dist.npm ? +dist.npm.split('.')[0] : 0;
78
- if (bundledNpmMajor >= 3) {
79
- cb(); // npm >= 3 bundled, skip download
80
- return;
81
- }
82
- // old npm (<3) is buggy - delete it so installNPM can override
83
- const platform = options.platform;
84
- const libPath = platform === 'win32' ? tempPath : path.join(tempPath, 'lib');
85
- const npmPath = path.join(libPath, 'node_modules', 'npm');
86
- safeRm(npmPath, ()=>installNPM(version, tempPath, options, cb));
87
- return;
88
- }
89
- installNPM(version, tempPath, options, cb);
90
- });
91
- });
92
- // Atomic rename: move temp folder to final destination
93
- queue.defer((cb)=>{
94
- fs.rename(tempPath, result.installPath, (err)=>{
95
- if (!err) return cb();
96
- // Race condition: another process may have already created dest
97
- if (err.code === 'EEXIST' || err.code === 'ENOTEMPTY' || err.code === 'EPERM') {
98
- // Another process won the race - clean up temp and succeed
99
- safeRm(tempPath, ()=>cb());
52
+ // Folder doesn't exist - do atomic install with temp folder
53
+ const tempPath = tempSuffix(result.installPath);
54
+ const queue = new Queue(1);
55
+ queue.defer(mkdirp.bind(null, options.cachePath));
56
+ queue.defer(ensureDestinationParent.bind(null, tempPath));
57
+ // Install node to temp folder
58
+ queue.defer(installNode.bind(null, version, tempPath, options));
59
+ // Check and install npm to temp folder
60
+ // Skip npm download only if bundled npm is modern (>= 3)
61
+ queue.defer((cb)=>{
62
+ checkMissing(tempPath, options, (err, npmMissing)=>{
63
+ if (err) {
64
+ cb(err);
65
+ return;
66
+ }
67
+ if (!~npmMissing.indexOf('npm')) {
68
+ // npm is present (bundled with node) - check if it's modern enough to keep
69
+ const dist = getDist(version);
70
+ const bundledNpmMajor = dist && dist.npm ? +dist.npm.split('.')[0] : 0;
71
+ if (bundledNpmMajor >= 3) {
72
+ cb(); // npm >= 3 bundled, skip download
100
73
  return;
101
74
  }
102
- cb(err);
103
- });
75
+ // old npm (<3) is buggy - delete it so installNPM can override
76
+ const platform = options.platform;
77
+ const libPath = platform === 'win32' ? tempPath : path.join(tempPath, 'lib');
78
+ const npmPath = path.join(libPath, 'node_modules', 'npm');
79
+ safeRm(npmPath, ()=>installNPM(version, tempPath, options, cb));
80
+ return;
81
+ }
82
+ installNPM(version, tempPath, options, cb);
104
83
  });
105
- queue.await((err)=>{
106
- if (err) {
107
- // Clean up temp folder on error
108
- safeRm(tempPath, ()=>callback(err));
84
+ });
85
+ // Atomic rename: move temp folder to final destination
86
+ queue.defer((cb)=>{
87
+ fs.rename(tempPath, result.installPath, (err)=>{
88
+ if (!err) return cb();
89
+ // Race condition: another process may have already created dest
90
+ if (err.code === 'EEXIST' || err.code === 'ENOTEMPTY' || err.code === 'EPERM') {
91
+ // Another process won the race - clean up temp and succeed
92
+ safeRm(tempPath, ()=>cb());
109
93
  return;
110
94
  }
111
- callback(null, result);
95
+ cb(err);
112
96
  });
113
97
  });
98
+ queue.await((err)=>{
99
+ if (err) {
100
+ // Clean up temp folder on error
101
+ safeRm(tempPath, ()=>callback(err));
102
+ return;
103
+ }
104
+ callback(null, result);
105
+ });
114
106
  });
115
107
  });
116
108
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/workers/install.ts"],"sourcesContent":["import fs from 'fs';\nimport { safeRm } from 'fs-remove-compat';\nimport isVersion from 'is-version';\nimport mkdirp from 'mkdirp-classic';\nimport { getDist } from 'node-filename-to-dist-paths';\nimport resolveVersions from 'node-resolve-versions';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport tempSuffix from 'temp-suffix';\n\nimport { DEFAULT_STORAGE_PATHS } from '../constants.ts';\n\nimport createResult from '../createResult.ts';\nimport createStoragePaths from '../createStoragePaths.ts';\nimport installNode from '../installNode/index.ts';\n\nimport installNPM from '../installNPM/index.ts';\nimport checkMissing from '../lib/checkMissing.ts';\nimport ensureDestinationParent from '../lib/ensureDestinationParent.ts';\nimport getTarget from '../lib/getTarget.ts';\n\nimport type { InstallCallback, InstallOptions } from '../types.ts';\n\ntype GetVersionsCallback = (error?: Error, results?: string[]) => undefined;\nfunction getVersions(versionExpression: string, options: InstallOptions, callback: GetVersionsCallback): undefined {\n // short circuit\n isVersion(versionExpression) ? callback(null, [versionExpression]) : resolveVersions(versionExpression, options, callback);\n}\n\nexport default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): undefined {\n const storagePaths = options.storagePath ? createStoragePaths(options.storagePath) : DEFAULT_STORAGE_PATHS;\n options = { ...storagePaths, ...options, ...getTarget(options) };\n getVersions(versionExpression, options, (err?: Error, versions?: string[]): undefined => {\n if (err) {\n callback(err);\n return;\n }\n if (!versions.length) {\n callback(new Error(`Could not resolve versions for: ${versionExpression}`));\n return;\n }\n if (versions.length !== 1) {\n callback(new Error(`Version ${versionExpression} resolved to multiple versions: ${versions.map((x) => x)}. Expecting one.`));\n return;\n }\n\n const version = versions[0];\n const result = createResult(options, version);\n\n // Fast path: check if installation is complete\n checkMissing(result.installPath, options, (err, missing): undefined => {\n if (err) {\n callback(err);\n return;\n }\n\n // Early exit if both node and npm are already present\n if (!missing.length) {\n callback(null, result);\n return;\n }\n\n // Something is missing - use atomic pattern with temp folder\n // First, remove any partial installation to avoid conflicts\n safeRm(result.installPath, () => {\n const tempPath = tempSuffix(result.installPath);\n\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, options.cachePath));\n queue.defer(ensureDestinationParent.bind(null, tempPath));\n\n // Install node to temp folder\n queue.defer(installNode.bind(null, version, tempPath, options));\n\n // Check and install npm to temp folder\n // Skip npm download only if bundled npm is modern (>= 3)\n queue.defer((cb) => {\n checkMissing(tempPath, options, (err, npmMissing): undefined => {\n if (err) {\n cb(err);\n return;\n }\n if (!~npmMissing.indexOf('npm')) {\n // npm is present (bundled with node) - check if it's modern enough to keep\n const dist = getDist(version);\n const bundledNpmMajor = dist && dist.npm ? +dist.npm.split('.')[0] : 0;\n if (bundledNpmMajor >= 3) {\n cb(); // npm >= 3 bundled, skip download\n return;\n }\n // old npm (<3) is buggy - delete it so installNPM can override\n const platform = options.platform;\n const libPath = platform === 'win32' ? tempPath : path.join(tempPath, 'lib');\n const npmPath = path.join(libPath, 'node_modules', 'npm');\n safeRm(npmPath, () => installNPM(version, tempPath, options, cb));\n return;\n }\n installNPM(version, tempPath, options, cb);\n });\n });\n\n // Atomic rename: move temp folder to final destination\n queue.defer((cb) => {\n fs.rename(tempPath, result.installPath, (err) => {\n if (!err) return cb();\n // Race condition: another process may have already created dest\n if (err.code === 'EEXIST' || err.code === 'ENOTEMPTY' || err.code === 'EPERM') {\n // Another process won the race - clean up temp and succeed\n safeRm(tempPath, () => cb());\n return;\n }\n cb(err);\n });\n });\n\n queue.await((err) => {\n if (err) {\n // Clean up temp folder on error\n safeRm(tempPath, () => callback(err));\n return;\n }\n callback(null, result);\n });\n });\n });\n });\n}\n"],"names":["fs","safeRm","isVersion","mkdirp","getDist","resolveVersions","path","Queue","tempSuffix","DEFAULT_STORAGE_PATHS","createResult","createStoragePaths","installNode","installNPM","checkMissing","ensureDestinationParent","getTarget","getVersions","versionExpression","options","callback","install","storagePaths","storagePath","err","versions","length","Error","map","x","version","result","installPath","missing","tempPath","queue","defer","bind","cachePath","cb","npmMissing","indexOf","dist","bundledNpmMajor","npm","split","platform","libPath","join","npmPath","rename","code","await"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,eAAe,aAAa;AACnC,OAAOC,YAAY,iBAAiB;AACpC,SAASC,OAAO,QAAQ,8BAA8B;AACtD,OAAOC,qBAAqB,wBAAwB;AACpD,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,OAAOC,gBAAgB,cAAc;AAErC,SAASC,qBAAqB,QAAQ,kBAAkB;AAExD,OAAOC,kBAAkB,qBAAqB;AAC9C,OAAOC,wBAAwB,2BAA2B;AAC1D,OAAOC,iBAAiB,0BAA0B;AAElD,OAAOC,gBAAgB,yBAAyB;AAChD,OAAOC,kBAAkB,yBAAyB;AAClD,OAAOC,6BAA6B,oCAAoC;AACxE,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K;4BACvB;wBACF;wBACAA,GAAGf;oBACL;gBACF;gBAEAW,MAAMiB,KAAK,CAAC,CAAC5B;oBACX,IAAIA,KAAK;wBACP,gCAAgC;wBAChCvB,OAAOiC,UAAU,IAAMd,SAASI;wBAChC;oBACF;oBACAJ,SAAS,MAAMW;gBACjB;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-install-release/src/workers/install.ts"],"sourcesContent":["import fs from 'fs';\nimport { safeRm } from 'fs-remove-compat';\nimport isVersion from 'is-version';\nimport mkdirp from 'mkdirp-classic';\nimport { getDist } from 'node-filename-to-dist-paths';\nimport resolveVersions from 'node-resolve-versions';\nimport path from 'path';\nimport Queue from 'queue-cb';\nimport tempSuffix from 'temp-suffix';\n\nimport { DEFAULT_STORAGE_PATHS } from '../constants.ts';\n\nimport createResult from '../createResult.ts';\nimport createStoragePaths from '../createStoragePaths.ts';\nimport installNode from '../installNode/index.ts';\n\nimport installNPM from '../installNPM/index.ts';\nimport checkMissing from '../lib/checkMissing.ts';\nimport ensureDestinationParent from '../lib/ensureDestinationParent.ts';\nimport getTarget from '../lib/getTarget.ts';\n\nimport type { InstallCallback, InstallOptions } from '../types.ts';\n\ntype GetVersionsCallback = (error?: Error, results?: string[]) => undefined;\nfunction getVersions(versionExpression: string, options: InstallOptions, callback: GetVersionsCallback): undefined {\n // short circuit\n isVersion(versionExpression) ? callback(null, [versionExpression]) : resolveVersions(versionExpression, options, callback);\n}\n\nexport default function install(versionExpression: string, options: InstallOptions, callback: InstallCallback): undefined {\n const storagePaths = options.storagePath ? createStoragePaths(options.storagePath) : DEFAULT_STORAGE_PATHS;\n options = { ...storagePaths, ...options, ...getTarget(options) };\n getVersions(versionExpression, options, (err?: Error, versions?: string[]): undefined => {\n if (err) {\n callback(err);\n return;\n }\n if (!versions.length) {\n callback(new Error(`Could not resolve versions for: ${versionExpression}`));\n return;\n }\n if (versions.length !== 1) {\n callback(new Error(`Version ${versionExpression} resolved to multiple versions: ${versions.map((x) => x)}. Expecting one.`));\n return;\n }\n\n const version = versions[0];\n const result = createResult(options, version);\n\n // Fast path: with atomic installs, folder exists = complete installation\n fs.stat(result.installPath, (err) => {\n if (!err) {\n callback(null, result);\n return;\n }\n\n // Folder doesn't exist - do atomic install with temp folder\n const tempPath = tempSuffix(result.installPath);\n\n const queue = new Queue(1);\n queue.defer(mkdirp.bind(null, options.cachePath));\n queue.defer(ensureDestinationParent.bind(null, tempPath));\n\n // Install node to temp folder\n queue.defer(installNode.bind(null, version, tempPath, options));\n\n // Check and install npm to temp folder\n // Skip npm download only if bundled npm is modern (>= 3)\n queue.defer((cb) => {\n checkMissing(tempPath, options, (err, npmMissing): undefined => {\n if (err) {\n cb(err);\n return;\n }\n if (!~npmMissing.indexOf('npm')) {\n // npm is present (bundled with node) - check if it's modern enough to keep\n const dist = getDist(version);\n const bundledNpmMajor = dist && dist.npm ? +dist.npm.split('.')[0] : 0;\n if (bundledNpmMajor >= 3) {\n cb(); // npm >= 3 bundled, skip download\n return;\n }\n // old npm (<3) is buggy - delete it so installNPM can override\n const platform = options.platform;\n const libPath = platform === 'win32' ? tempPath : path.join(tempPath, 'lib');\n const npmPath = path.join(libPath, 'node_modules', 'npm');\n safeRm(npmPath, () => installNPM(version, tempPath, options, cb));\n return;\n }\n installNPM(version, tempPath, options, cb);\n });\n });\n\n // Atomic rename: move temp folder to final destination\n queue.defer((cb) => {\n fs.rename(tempPath, result.installPath, (err) => {\n if (!err) return cb();\n // Race condition: another process may have already created dest\n if (err.code === 'EEXIST' || err.code === 'ENOTEMPTY' || err.code === 'EPERM') {\n // Another process won the race - clean up temp and succeed\n safeRm(tempPath, () => cb());\n return;\n }\n cb(err);\n });\n });\n\n queue.await((err) => {\n if (err) {\n // Clean up temp folder on error\n safeRm(tempPath, () => callback(err));\n return;\n }\n callback(null, result);\n });\n });\n });\n}\n"],"names":["fs","safeRm","isVersion","mkdirp","getDist","resolveVersions","path","Queue","tempSuffix","DEFAULT_STORAGE_PATHS","createResult","createStoragePaths","installNode","installNPM","checkMissing","ensureDestinationParent","getTarget","getVersions","versionExpression","options","callback","install","storagePaths","storagePath","err","versions","length","Error","map","x","version","result","stat","installPath","tempPath","queue","defer","bind","cachePath","cb","npmMissing","indexOf","dist","bundledNpmMajor","npm","split","platform","libPath","join","npmPath","rename","code","await"],"mappings":"AAAA,OAAOA,QAAQ,KAAK;AACpB,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,eAAe,aAAa;AACnC,OAAOC,YAAY,iBAAiB;AACpC,SAASC,OAAO,QAAQ,8BAA8B;AACtD,OAAOC,qBAAqB,wBAAwB;AACpD,OAAOC,UAAU,OAAO;AACxB,OAAOC,WAAW,WAAW;AAC7B,OAAOC,gBAAgB,cAAc;AAErC,SAASC,qBAAqB,QAAQ,kBAAkB;AAExD,OAAOC,kBAAkB,qBAAqB;AAC9C,OAAOC,wBAAwB,2BAA2B;AAC1D,OAAOC,iBAAiB,0BAA0B;AAElD,OAAOC,gBAAgB,yBAAyB;AAChD,OAAOC,kBAAkB,yBAAyB;AAClD,OAAOC,6BAA6B,oCAAoC;AACxE,OAAOC,eAAe,sBAAsB;AAK5C,SAASC,YAAYC,iBAAyB,EAAEC,OAAuB,EAAEC,QAA6B;IACpG,gBAAgB;IAChBlB,UAAUgB,qBAAqBE,SAAS,MAAM;QAACF;KAAkB,IAAIb,gBAAgBa,mBAAmBC,SAASC;AACnH;AAEA,eAAe,SAASC,QAAQH,iBAAyB,EAAEC,OAAuB,EAAEC,QAAyB;IAC3G,MAAME,eAAeH,QAAQI,WAAW,GAAGZ,mBAAmBQ,QAAQI,WAAW,IAAId;IACrFU,UAAU;QAAE,GAAGG,YAAY;QAAE,GAAGH,OAAO;QAAE,GAAGH,UAAUG,QAAQ;IAAC;IAC/DF,YAAYC,mBAAmBC,SAAS,CAACK,KAAaC;QACpD,IAAID,KAAK;YACPJ,SAASI;YACT;QACF;QACA,IAAI,CAACC,SAASC,MAAM,EAAE;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QAAQ;wBACjC,MAAMC,UAAUD,aAAa,UAAUZ,WAAW5B,KAAK0C,IAAI,CAACd,UAAU;wBACtE,MAAMe,UAAU3C,KAAK0C,IAAI,CAACD,SAAS,gBAAgB;wBACnD9C,OAAOgD,SAAS,IAAMpC,WAAWiB,SAASI,UAAUf,SAASoB;wBAC7D;oBACF;oBACA1B,WAAWiB,SAASI,UAAUf,SAASoB;gBACzC;YACF;YAEA,uDAAuD;YACvDJ,MAAMC,KAAK,CAAC,CAACG;gBACXvC,GAAGkD,MAAM,CAAChB,UAAUH,OAAOE,WAAW,EAAE,CAACT;oBACvC,IAAI,CAACA,KAAK,OAAOe;oBACjB,gEAAgE;oBAChE,IAAIf,IAAI2B,IAAI,KAAK,YAAY3B,IAAI2B,IAAI,KAAK,eAAe3B,IAAI2B,IAAI,KAAK,SAAS;wBAC7E,2DAA2D;wBAC3DlD,OAAOiC,UAAU,IAAMK;wBACvB;oBACF;oBACAA,GAAGf;gBACL;YACF;YAEAW,MAAMiB,KAAK,CAAC,CAAC5B;gBACX,IAAIA,KAAK;oBACP,gCAAgC;oBAChCvB,OAAOiC,UAAU,IAAMd,SAASI;oBAChC;gBACF;gBACAJ,SAAS,MAAMW;YACjB;QACF;IACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-install-release",
3
- "version": "1.16.1",
3
+ "version": "1.16.2",
4
4
  "description": "Cross-platform solution for installing releases of Node.js",
5
5
  "keywords": [
6
6
  "node",