@node-red/registry 3.1.8 → 3.1.9
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/lib/externalModules.js +1 -1
- package/lib/installer.js +11 -8
- package/package.json +3 -3
package/lib/externalModules.js
CHANGED
|
@@ -273,7 +273,7 @@ async function installModule(moduleDetails) {
|
|
|
273
273
|
let extraArgs = triggerPayload.args || [];
|
|
274
274
|
let args = ['install', ...extraArgs, installSpec]
|
|
275
275
|
log.trace(NPM_COMMAND + JSON.stringify(args));
|
|
276
|
-
return exec.run(NPM_COMMAND, args, { cwd: installDir },true)
|
|
276
|
+
return exec.run(NPM_COMMAND, args, { cwd: installDir, shell: true },true)
|
|
277
277
|
} else {
|
|
278
278
|
log.trace("skipping npm install");
|
|
279
279
|
}
|
package/lib/installer.js
CHANGED
|
@@ -25,12 +25,15 @@ const registryUtil = require("./util");
|
|
|
25
25
|
const library = require("./library");
|
|
26
26
|
const {exec,log,events,hooks} = require("@node-red/util");
|
|
27
27
|
const child_process = require('child_process');
|
|
28
|
-
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
29
|
-
let installerEnabled = false;
|
|
30
28
|
|
|
29
|
+
const isWindows = process.platform === 'win32'
|
|
30
|
+
const npmCommand = isWindows ? 'npm.cmd' : 'npm';
|
|
31
|
+
|
|
32
|
+
let installerEnabled = false;
|
|
31
33
|
let settings;
|
|
34
|
+
|
|
32
35
|
const moduleRe = /^(@[^/@]+?[/])?[^/@]+?$/;
|
|
33
|
-
const slashRe =
|
|
36
|
+
const slashRe = isWindows ? /\\|[/]/ : /[/]/;
|
|
34
37
|
const pkgurlRe = /^(https?|git(|\+https?|\+ssh|\+file)):\/\//;
|
|
35
38
|
const localtgzRe = /^([a-zA-Z]:|\/).+tgz$/;
|
|
36
39
|
|
|
@@ -225,7 +228,7 @@ async function installModule(module,version,url) {
|
|
|
225
228
|
let extraArgs = triggerPayload.args || [];
|
|
226
229
|
let args = ['install', ...extraArgs, installName]
|
|
227
230
|
log.trace(npmCommand + JSON.stringify(args));
|
|
228
|
-
return exec.run(npmCommand,args,{ cwd: installDir}, true)
|
|
231
|
+
return exec.run(npmCommand,args,{ cwd: installDir, shell: true }, true)
|
|
229
232
|
} else {
|
|
230
233
|
log.trace("skipping npm install");
|
|
231
234
|
}
|
|
@@ -260,7 +263,7 @@ async function installModule(module,version,url) {
|
|
|
260
263
|
log.warn("------------------------------------------");
|
|
261
264
|
e = new Error(log._("server.install.install-failed")+": "+err.toString());
|
|
262
265
|
if (err.hook === "postInstall") {
|
|
263
|
-
return exec.run(npmCommand,["remove",module],{ cwd: installDir}, false).finally(() => {
|
|
266
|
+
return exec.run(npmCommand,["remove",module],{ cwd: installDir, shell: true }, false).finally(() => {
|
|
264
267
|
throw e;
|
|
265
268
|
})
|
|
266
269
|
}
|
|
@@ -356,7 +359,7 @@ async function getModuleVersionFromNPM(module, version) {
|
|
|
356
359
|
}
|
|
357
360
|
|
|
358
361
|
return new Promise((resolve, reject) => {
|
|
359
|
-
child_process.execFile(npmCommand,['info','--json',installName],function(err,stdout,stderr) {
|
|
362
|
+
child_process.execFile(npmCommand,['info','--json',installName],{ shell: true },function(err,stdout,stderr) {
|
|
360
363
|
try {
|
|
361
364
|
if (!stdout) {
|
|
362
365
|
log.warn(log._("server.install.install-failed-not-found",{name:module}));
|
|
@@ -511,7 +514,7 @@ function uninstallModule(module) {
|
|
|
511
514
|
let extraArgs = triggerPayload.args || [];
|
|
512
515
|
let args = ['remove', ...extraArgs, module]
|
|
513
516
|
log.trace(npmCommand + JSON.stringify(args));
|
|
514
|
-
return exec.run(npmCommand,args,{ cwd: installDir}, true)
|
|
517
|
+
return exec.run(npmCommand,args,{ cwd: installDir, shell: true }, true)
|
|
515
518
|
} else {
|
|
516
519
|
log.trace("skipping npm uninstall");
|
|
517
520
|
}
|
|
@@ -578,7 +581,7 @@ async function checkPrereq() {
|
|
|
578
581
|
installerEnabled = false;
|
|
579
582
|
} else {
|
|
580
583
|
return new Promise(resolve => {
|
|
581
|
-
child_process.execFile(npmCommand,['-v'],function(err,stdout) {
|
|
584
|
+
child_process.execFile(npmCommand,['-v'],{ shell: true },function(err,stdout) {
|
|
582
585
|
if (err) {
|
|
583
586
|
log.info(log._("server.palette-editor.npm-not-found"));
|
|
584
587
|
installerEnabled = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-red/registry",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.9",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@node-red/util": "3.1.
|
|
19
|
+
"@node-red/util": "3.1.9",
|
|
20
20
|
"clone": "2.1.2",
|
|
21
21
|
"fs-extra": "11.1.1",
|
|
22
22
|
"semver": "7.5.4",
|
|
23
|
-
"tar": "6.1
|
|
23
|
+
"tar": "6.2.1",
|
|
24
24
|
"uglify-js": "3.17.4"
|
|
25
25
|
}
|
|
26
26
|
}
|