freefoote / node-red-flows-mongo

2 stars 4 forks source link

TypeError: config.forEach is not a function #4

Open crizhon opened 7 years ago

crizhon commented 7 years ago

When i try to use node-red-flows-mongo i get these errors:

In server start

Potentially unhandled rejection [1] TypeError: config.forEach is not a function at Object.module.exports.parseConfig (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red/red/runtime/nodes/flows/util.js:52:16) at /Users/cristianschonmeier/Documents/tche-server/node_modules/node-red/red/runtime/nodes/flows/index.js:100:38 at tryCatchReject (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red-flows-mongo/node_modules/when/lib/makePromise.js:845:30) at runContinuation1 (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red-flows-mongo/node_modules/when/lib/makePromise.js:804:4) at Fulfilled.when (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red-flows-mongo/node_modules/when/lib/makePromise.js:592:4) at Pending.run (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red-flows-mongo/node_modules/when/lib/makePromise.js:483:13) at Scheduler._drain (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red-flows-mongo/node_modules/when/lib/Scheduler.js:62:19) at Scheduler.drain (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red-flows-mongo/node_modules/when/lib/Scheduler.js:27:9) at doNTCallback0 (node.js:419:9) at process._tickCallback (node.js:348:13)

When i try access the server:

Potentially unhandled rejection [2] TypeError: Cannot read property 'forEach' of undefined at /Users/cristianschonmeier/Documents/tche-server/node_modules/node-red/red/runtime/storage/index.js:184:16 at init (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red/node_modules/when/lib/makePromise.js:39:5) at new Promise (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red/node_modules/when/lib/makePromise.js:27:53) at Function.promise (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red/node_modules/when/when.js:97:10) at /Users/cristianschonmeier/Documents/tche-server/node_modules/node-red/red/runtime/storage/index.js:182:21 at tryCatchReject (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red-flows-mongo/node_modules/when/lib/makePromise.js:845:30) at runContinuation1 (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red-flows-mongo/node_modules/when/lib/makePromise.js:804:4) at Fulfilled.when (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red-flows-mongo/node_modules/when/lib/makePromise.js:592:4) at Pending.run (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red-flows-mongo/node_modules/when/lib/makePromise.js:483:13) at Scheduler._drain (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red-flows-mongo/node_modules/when/lib/Scheduler.js:62:19) at Scheduler.drain (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red-flows-mongo/node_modules/when/lib/Scheduler.js:27:9) at doNTCallback0 (node.js:419:9) at process._tickCallback (node.js:348:13)

When i try to save a new flow:

TypeError: Cannot read property 'rev' of null at module.exports.post (/Users/cristianschonmeier/Documents/tche-server/node_modules/node-red/red/api/flows.js:58:61) at Layer.handle [as handle_request] (/Users/cristianschonmeier/Documents/tche-server/node_modules/express/lib/router/layer.js:95:5) at next (/Users/cristianschonmeier/Documents/tche-server/node_modules/express/lib/router/route.js:131:13) at /Users/cristianschonmeier/Documents/tche-server/node_modules/node-red/red/api/auth/index.js:63:13 at Layer.handle [as handle_request] (/Users/cristianschonmeier/Documents/tche-server/node_modules/express/lib/router/layer.js:95:5) at next (/Users/cristianschonmeier/Documents/tche-server/node_modules/express/lib/router/route.js:131:13) at Route.dispatch (/Users/cristianschonmeier/Documents/tche-server/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/Users/cristianschonmeier/Documents/tche-server/node_modules/express/lib/router/layer.js:95:5) at /Users/cristianschonmeier/Documents/tche-server/node_modules/express/lib/router/index.js:277:22 at Function.process_params (/Users/cristianschonmeier/Documents/tche-server/node_modules/express/lib/router/index.js:330:12) at next (/Users/cristianschonmeier/Documents/tche-server/node_modules/express/lib/router/index.js:271:10) at urlencodedParser (/Users/cristianschonmeier/Documents/tche-server/node_modules/body-parser/lib/types/urlencoded.js:82:7) at Layer.handle [as handle_request] (/Users/cristianschonmeier/Documents/tche-server/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/Users/cristianschonmeier/Documents/tche-server/node_modules/express/lib/router/index.js:312:13) at /Users/cristianschonmeier/Documents/tche-server/node_modules/express/lib/router/index.js:280:7 at Function.process_params (/Users/cristianschonmeier/Documents/tche-server/node_modules/express/lib/router/index.js:330:12)

My node-red settings

var settings = {
    httpAdminRoot: "/red",
    httpNodeRoot: "/api",
    storageModule: require("node-red-flows-mongo"),
    mongoUrl: 'mongodb://localhost/nodered',
};

Whitout node-red-flows-mongo run normally.

npm -v 2.14.7

node -v v4.2.2

abewartech commented 4 years ago

Any idea to fix this, i have same issue here