Skip to content

Commit aecc040

Browse files
committed
Fix fucked up error in NPM removing API!!!!
1 parent 3553dbb commit aecc040

7 files changed

Lines changed: 22 additions & 31 deletions

File tree

OpenFlowNodeRED/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# FROM node:lts
2-
FROM node:16.9.1
1+
FROM node:lts
32
EXPOSE 80
43
EXPOSE 5859
54

OpenFlowNodeRED/Dockerfilepuppeteer

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# FROM node:lts
2-
FROM node:16.9.1
1+
FROM node:lts
32
EXPOSE 80
43
EXPOSE 5859
54
RUN apt-get update \

OpenFlowNodeRED/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/nodered",
3-
"version": "1.3.89",
3+
"version": "1.3.90",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {
@@ -39,7 +39,6 @@
3939
"envfile": "^6.17.0",
4040
"express": "^4.17.1",
4141
"express-session": "^1.17.2",
42-
"global-npm": "^0.4.1",
4342
"google-auth-library": "^7.0.4",
4443
"jsonwebtoken": "^8.5.1",
4544
"morgan": "^1.10.0",
@@ -56,4 +55,4 @@
5655
"@types/compression": "^1.7.2",
5756
"@types/node": "^16.11.4"
5857
}
59-
}
58+
}

OpenFlowNodeRED/src/node-red-contrib-openflow-storage.ts

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -122,24 +122,18 @@ export class noderedcontribopenflowstorage {
122122
});
123123
return results;
124124
}
125-
getGlobalModulesDir() {
126-
return new Promise<string>((resolve, reject) => {
127-
try {
128-
var npm = require("global-npm")
129-
// work around for https://github.com/npm/cli/issues/2137
130-
npm.load(function (err) {
131-
if (err) return reject(err)
132-
resolve(npm.globalPrefix);
133-
})
134-
} catch (error) {
135-
return reject(error)
136-
}
137-
});
138-
}
139125
async GetMissingModules(settings: any) {
140-
const globaldir = await this.getGlobalModulesDir();
141126
let currentmodules = this.scanDirForNodesModules(path.resolve('.'));
142-
currentmodules = currentmodules.concat(this.scanDirForNodesModules(globaldir));
127+
try {
128+
let globaldir: string = child_process.execSync('npm root -g').toString();
129+
if (globaldir.indexOf('\n')) {
130+
if (globaldir.endsWith('\n')) globaldir = globaldir.substr(0, globaldir.length - 1);
131+
globaldir = globaldir.substr(globaldir.lastIndexOf('\n') + 1);
132+
}
133+
if (globaldir != null && globaldir != "") currentmodules = currentmodules.concat(this.scanDirForNodesModules(globaldir));
134+
} catch (error) {
135+
console.error(error);
136+
}
143137
const keys = Object.keys(settings.nodes);
144138
let modules = "";
145139
for (let i = 0; i < keys.length; i++) {

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.89
1+
1.3.90

gulpfile.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,12 @@ gulp.task("compose", shell.task([
236236
'docker push openiap/nodered-puppeteer:edge',
237237
'docker push openiap/nodered-puppeteer:' + version,
238238

239-
'echo "Build openiap/nodered-tagui"',
240-
'cd OpenFlowNodeRED && docker build -t openiap/nodered-tagui:edge -f Dockerfiletagui .',
241-
'docker tag openiap/nodered-tagui:edge openiap/nodered-tagui:' + version,
242-
'echo "Push openiap/nodered-tagui"',
243-
'docker push openiap/nodered-tagui:edge',
244-
'docker push openiap/nodered-tagui:' + version,
239+
// 'echo "Build openiap/nodered-tagui"',
240+
// 'cd OpenFlowNodeRED && docker build -t openiap/nodered-tagui:edge -f Dockerfiletagui .',
241+
// 'docker tag openiap/nodered-tagui:edge openiap/nodered-tagui:' + version,
242+
// 'echo "Push openiap/nodered-tagui"',
243+
// 'docker push openiap/nodered-tagui:edge',
244+
// 'docker push openiap/nodered-tagui:' + version,
245245

246246
]));
247247

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openiap/openflow",
3-
"version": "1.3.89",
3+
"version": "1.3.90",
44
"description": "Simple wrapper around NodeRed, RabbitMQ and MongoDB to support a more scaleable NodeRed implementation.\r Also the \"backend\" for [OpenRPA](https://github.com/skadefro/OpenRPA)",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)