node-version-utils 1.3.13 → 1.3.15
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.
package/dist/cjs/spawnOptions.js
CHANGED
|
@@ -99,11 +99,11 @@ function spawnOptions(installPath) {
|
|
|
99
99
|
// override node
|
|
100
100
|
if (env.NODE !== undefined) env.NODE = env.npm_node_execpath;
|
|
101
101
|
if (env.NODE_EXE !== undefined) env.NODE_EXE = env.npm_node_execpath;
|
|
102
|
-
// put the path to node and npm at the front
|
|
103
|
-
var basePath = env[PATH_KEY] || process.env[PATH_KEY] || '';
|
|
102
|
+
// put the path to node and npm at the front
|
|
104
103
|
if (options.env && !options.env[PATH_KEY]) {
|
|
105
|
-
|
|
104
|
+
throw new Error("node-version-utils: options.env missing required ".concat(PATH_KEY));
|
|
106
105
|
}
|
|
106
|
+
var basePath = env[PATH_KEY] || process.env[PATH_KEY] || '';
|
|
107
107
|
env[PATH_KEY] = (0, _pathstringprepend.default)(basePath, bin);
|
|
108
108
|
return _object_spread_props(_object_spread({}, options), {
|
|
109
109
|
cwd: process.cwd(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-utils/src/spawnOptions.ts"],"sourcesContent":["import pathKey from 'env-path-key';\nimport fs from 'fs';\nimport path from 'path';\nimport prepend from 'path-string-prepend';\nimport startsWithFn from './lib/startsWithFn.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nconst NODE = isWindows ? 'node.exe' : 'node';\n\nconst startsNPM = startsWithFn('npm_');\nconst startsPath = startsWithFn('path');\n\nimport type { ProcessEnv, SpawnOptions } from './types.ts';\n\nexport default function spawnOptions(installPath: string, options: SpawnOptions = {}): SpawnOptions {\n // Resolve symlinks to get real path (fixes nvm-windows symlink issues where\n // C:\\nvm4w\\nodejs points to the active Node version via symlink)\n try {\n installPath = fs.realpathSync(installPath);\n } catch (_e) {\n // Keep original path if resolution fails\n }\n\n const PATH_KEY = pathKey();\n const processEnv = options.env || process.env;\n const bin = isWindows ? installPath : path.join(installPath, 'bin');\n const env = {} as ProcessEnv;\n env.npm_node_execpath = path.join(bin, NODE);\n env.npm_config_prefix = installPath;\n\n // copy the environment not for npm and skip case-insesitive additional paths\n for (const key in processEnv) {\n // skip npm_ variants and non-matching path\n if (key.length > 4 && startsNPM(key)) continue;\n if (key.length === 4 && startsPath(key) && key !== PATH_KEY) continue;\n env[key] = processEnv[key];\n }\n\n // override node\n if (env.NODE !== undefined) env.NODE = env.npm_node_execpath;\n if (env.NODE_EXE !== undefined) env.NODE_EXE = env.npm_node_execpath;\n\n // put the path to node and npm at the front
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-utils/src/spawnOptions.ts"],"sourcesContent":["import pathKey from 'env-path-key';\nimport fs from 'fs';\nimport path from 'path';\nimport prepend from 'path-string-prepend';\nimport startsWithFn from './lib/startsWithFn.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nconst NODE = isWindows ? 'node.exe' : 'node';\n\nconst startsNPM = startsWithFn('npm_');\nconst startsPath = startsWithFn('path');\n\nimport type { ProcessEnv, SpawnOptions } from './types.ts';\n\nexport default function spawnOptions(installPath: string, options: SpawnOptions = {}): SpawnOptions {\n // Resolve symlinks to get real path (fixes nvm-windows symlink issues where\n // C:\\nvm4w\\nodejs points to the active Node version via symlink)\n try {\n installPath = fs.realpathSync(installPath);\n } catch (_e) {\n // Keep original path if resolution fails\n }\n\n const PATH_KEY = pathKey();\n const processEnv = options.env || process.env;\n const bin = isWindows ? installPath : path.join(installPath, 'bin');\n const env = {} as ProcessEnv;\n env.npm_node_execpath = path.join(bin, NODE);\n env.npm_config_prefix = installPath;\n\n // copy the environment not for npm and skip case-insesitive additional paths\n for (const key in processEnv) {\n // skip npm_ variants and non-matching path\n if (key.length > 4 && startsNPM(key)) continue;\n if (key.length === 4 && startsPath(key) && key !== PATH_KEY) continue;\n env[key] = processEnv[key];\n }\n\n // override node\n if (env.NODE !== undefined) env.NODE = env.npm_node_execpath;\n if (env.NODE_EXE !== undefined) env.NODE_EXE = env.npm_node_execpath;\n\n // put the path to node and npm at the front\n if (options.env && !options.env[PATH_KEY]) {\n throw new Error(`node-version-utils: options.env missing required ${PATH_KEY}`);\n }\n const basePath = env[PATH_KEY] || process.env[PATH_KEY] || '';\n env[PATH_KEY] = prepend(basePath, bin) as string;\n return { ...options, cwd: process.cwd(), env } as SpawnOptions;\n}\n"],"names":["spawnOptions","isWindows","process","platform","test","env","OSTYPE","NODE","startsNPM","startsWithFn","startsPath","installPath","options","fs","realpathSync","_e","PATH_KEY","pathKey","processEnv","bin","path","join","npm_node_execpath","npm_config_prefix","key","length","undefined","NODE_EXE","Error","basePath","prepend","cwd"],"mappings":";;;;+BAcA;;;eAAwBA;;;iEAdJ;yDACL;2DACE;wEACG;qEACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzB,IAAMC,YAAYC,QAAQC,QAAQ,KAAK,WAAW,kBAAkBC,IAAI,CAACF,QAAQG,GAAG,CAACC,MAAM;AAC3F,IAAMC,OAAON,YAAY,aAAa;AAEtC,IAAMO,YAAYC,IAAAA,uBAAY,EAAC;AAC/B,IAAMC,aAAaD,IAAAA,uBAAY,EAAC;AAIjB,SAAST,aAAaW,WAAmB;QAAEC,UAAAA,iEAAwB,CAAC;IACjF,4EAA4E;IAC5E,iEAAiE;IACjE,IAAI;QACFD,cAAcE,WAAE,CAACC,YAAY,CAACH;IAChC,EAAE,OAAOI,IAAI;IACX,yCAAyC;IAC3C;IAEA,IAAMC,WAAWC,IAAAA,mBAAO;IACxB,IAAMC,aAAaN,QAAQP,GAAG,IAAIH,QAAQG,GAAG;IAC7C,IAAMc,MAAMlB,YAAYU,cAAcS,aAAI,CAACC,IAAI,CAACV,aAAa;IAC7D,IAAMN,MAAM,CAAC;IACbA,IAAIiB,iBAAiB,GAAGF,aAAI,CAACC,IAAI,CAACF,KAAKZ;IACvCF,IAAIkB,iBAAiB,GAAGZ;IAExB,6EAA6E;IAC7E,IAAK,IAAMa,OAAON,WAAY;QAC5B,2CAA2C;QAC3C,IAAIM,IAAIC,MAAM,GAAG,KAAKjB,UAAUgB,MAAM;QACtC,IAAIA,IAAIC,MAAM,KAAK,KAAKf,WAAWc,QAAQA,QAAQR,UAAU;QAC7DX,GAAG,CAACmB,IAAI,GAAGN,UAAU,CAACM,IAAI;IAC5B;IAEA,gBAAgB;IAChB,IAAInB,IAAIE,IAAI,KAAKmB,WAAWrB,IAAIE,IAAI,GAAGF,IAAIiB,iBAAiB;IAC5D,IAAIjB,IAAIsB,QAAQ,KAAKD,WAAWrB,IAAIsB,QAAQ,GAAGtB,IAAIiB,iBAAiB;IAEpE,4CAA4C;IAC5C,IAAIV,QAAQP,GAAG,IAAI,CAACO,QAAQP,GAAG,CAACW,SAAS,EAAE;QACzC,MAAM,IAAIY,MAAM,AAAC,oDAA4D,OAATZ;IACtE;IACA,IAAMa,WAAWxB,GAAG,CAACW,SAAS,IAAId,QAAQG,GAAG,CAACW,SAAS,IAAI;IAC3DX,GAAG,CAACW,SAAS,GAAGc,IAAAA,0BAAO,EAACD,UAAUV;IAClC,OAAO,wCAAKP;QAASmB,KAAK7B,QAAQ6B,GAAG;QAAI1B,KAAAA;;AAC3C"}
|
package/dist/esm/spawnOptions.js
CHANGED
|
@@ -31,11 +31,11 @@ export default function spawnOptions(installPath, options = {}) {
|
|
|
31
31
|
// override node
|
|
32
32
|
if (env.NODE !== undefined) env.NODE = env.npm_node_execpath;
|
|
33
33
|
if (env.NODE_EXE !== undefined) env.NODE_EXE = env.npm_node_execpath;
|
|
34
|
-
// put the path to node and npm at the front
|
|
35
|
-
const basePath = env[PATH_KEY] || process.env[PATH_KEY] || '';
|
|
34
|
+
// put the path to node and npm at the front
|
|
36
35
|
if (options.env && !options.env[PATH_KEY]) {
|
|
37
|
-
|
|
36
|
+
throw new Error(`node-version-utils: options.env missing required ${PATH_KEY}`);
|
|
38
37
|
}
|
|
38
|
+
const basePath = env[PATH_KEY] || process.env[PATH_KEY] || '';
|
|
39
39
|
env[PATH_KEY] = prepend(basePath, bin);
|
|
40
40
|
return {
|
|
41
41
|
...options,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-utils/src/spawnOptions.ts"],"sourcesContent":["import pathKey from 'env-path-key';\nimport fs from 'fs';\nimport path from 'path';\nimport prepend from 'path-string-prepend';\nimport startsWithFn from './lib/startsWithFn.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nconst NODE = isWindows ? 'node.exe' : 'node';\n\nconst startsNPM = startsWithFn('npm_');\nconst startsPath = startsWithFn('path');\n\nimport type { ProcessEnv, SpawnOptions } from './types.ts';\n\nexport default function spawnOptions(installPath: string, options: SpawnOptions = {}): SpawnOptions {\n // Resolve symlinks to get real path (fixes nvm-windows symlink issues where\n // C:\\nvm4w\\nodejs points to the active Node version via symlink)\n try {\n installPath = fs.realpathSync(installPath);\n } catch (_e) {\n // Keep original path if resolution fails\n }\n\n const PATH_KEY = pathKey();\n const processEnv = options.env || process.env;\n const bin = isWindows ? installPath : path.join(installPath, 'bin');\n const env = {} as ProcessEnv;\n env.npm_node_execpath = path.join(bin, NODE);\n env.npm_config_prefix = installPath;\n\n // copy the environment not for npm and skip case-insesitive additional paths\n for (const key in processEnv) {\n // skip npm_ variants and non-matching path\n if (key.length > 4 && startsNPM(key)) continue;\n if (key.length === 4 && startsPath(key) && key !== PATH_KEY) continue;\n env[key] = processEnv[key];\n }\n\n // override node\n if (env.NODE !== undefined) env.NODE = env.npm_node_execpath;\n if (env.NODE_EXE !== undefined) env.NODE_EXE = env.npm_node_execpath;\n\n // put the path to node and npm at the front
|
|
1
|
+
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/node-version/node-version-utils/src/spawnOptions.ts"],"sourcesContent":["import pathKey from 'env-path-key';\nimport fs from 'fs';\nimport path from 'path';\nimport prepend from 'path-string-prepend';\nimport startsWithFn from './lib/startsWithFn.ts';\n\nconst isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);\nconst NODE = isWindows ? 'node.exe' : 'node';\n\nconst startsNPM = startsWithFn('npm_');\nconst startsPath = startsWithFn('path');\n\nimport type { ProcessEnv, SpawnOptions } from './types.ts';\n\nexport default function spawnOptions(installPath: string, options: SpawnOptions = {}): SpawnOptions {\n // Resolve symlinks to get real path (fixes nvm-windows symlink issues where\n // C:\\nvm4w\\nodejs points to the active Node version via symlink)\n try {\n installPath = fs.realpathSync(installPath);\n } catch (_e) {\n // Keep original path if resolution fails\n }\n\n const PATH_KEY = pathKey();\n const processEnv = options.env || process.env;\n const bin = isWindows ? installPath : path.join(installPath, 'bin');\n const env = {} as ProcessEnv;\n env.npm_node_execpath = path.join(bin, NODE);\n env.npm_config_prefix = installPath;\n\n // copy the environment not for npm and skip case-insesitive additional paths\n for (const key in processEnv) {\n // skip npm_ variants and non-matching path\n if (key.length > 4 && startsNPM(key)) continue;\n if (key.length === 4 && startsPath(key) && key !== PATH_KEY) continue;\n env[key] = processEnv[key];\n }\n\n // override node\n if (env.NODE !== undefined) env.NODE = env.npm_node_execpath;\n if (env.NODE_EXE !== undefined) env.NODE_EXE = env.npm_node_execpath;\n\n // put the path to node and npm at the front\n if (options.env && !options.env[PATH_KEY]) {\n throw new Error(`node-version-utils: options.env missing required ${PATH_KEY}`);\n }\n const basePath = env[PATH_KEY] || process.env[PATH_KEY] || '';\n env[PATH_KEY] = prepend(basePath, bin) as string;\n return { ...options, cwd: process.cwd(), env } as SpawnOptions;\n}\n"],"names":["pathKey","fs","path","prepend","startsWithFn","isWindows","process","platform","test","env","OSTYPE","NODE","startsNPM","startsPath","spawnOptions","installPath","options","realpathSync","_e","PATH_KEY","processEnv","bin","join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c,iBAAiB;IAEpE,4CAA4C;IAC5C,IAAIP,QAAQP,GAAG,IAAI,CAACO,QAAQP,GAAG,CAACU,SAAS,EAAE;QACzC,MAAM,IAAIU,MAAM,CAAC,iDAAiD,EAAEV,UAAU;IAChF;IACA,MAAMW,WAAWrB,GAAG,CAACU,SAAS,IAAIb,QAAQG,GAAG,CAACU,SAAS,IAAI;IAC3DV,GAAG,CAACU,SAAS,GAAGhB,QAAQ2B,UAAUT;IAClC,OAAO;QAAE,GAAGL,OAAO;QAAEe,KAAKzB,QAAQyB,GAAG;QAAItB;IAAI;AAC/C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-version-utils",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.15",
|
|
4
4
|
"description": "Utilities for running commands on a specific version of node by installed path",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -42,21 +42,21 @@
|
|
|
42
42
|
"version": "tsds version"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"env-path-key": "
|
|
46
|
-
"path-string-prepend": "
|
|
45
|
+
"env-path-key": "^1.1.6",
|
|
46
|
+
"path-string-prepend": "^1.1.6"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@types/mocha": "
|
|
50
|
-
"@types/node": "
|
|
51
|
-
"cr": "
|
|
52
|
-
"cross-spawn-cb": "
|
|
53
|
-
"fs-remove-compat": "
|
|
54
|
-
"is-version": "
|
|
55
|
-
"node-install-release": "
|
|
56
|
-
"node-resolve-versions": "
|
|
57
|
-
"node-version-use": "
|
|
58
|
-
"ts-dev-stack": "
|
|
59
|
-
"tsds-config": "
|
|
49
|
+
"@types/mocha": "^10.0.10",
|
|
50
|
+
"@types/node": "^24.10.1",
|
|
51
|
+
"cr": "^0.1.0",
|
|
52
|
+
"cross-spawn-cb": "^2.4.10",
|
|
53
|
+
"fs-remove-compat": "^0.2.1",
|
|
54
|
+
"is-version": "^1.0.7",
|
|
55
|
+
"node-install-release": "^1.15.7",
|
|
56
|
+
"node-resolve-versions": "^1.3.11",
|
|
57
|
+
"node-version-use": "^1.9.7",
|
|
58
|
+
"ts-dev-stack": "^1.21.2",
|
|
59
|
+
"tsds-config": "^0.2.0"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=0.8"
|