Sailsjs: Server crash after using create blueprint with mongodb

I configured the connections.js file in config. I used shortcut route to check whether data is getting stored in the database. I put the url localhost:1337/test/create?name=hello It creates an entry in the database but server crashes with this log

process.nextTick(function() { throw err; });
                                  ^

TypeError: Right-hand side of 'instanceof' is not callable
    at _hasBinary (/usr/local/lib/node_modules/sails/node_modules/has-binary/index.js:31:30)
    at hasBinary (/usr/local/lib/node_modules/sails/node_modules/has-binary/index.js:58:10)
    at Namespace.emit (/usr/local/lib/node_modules/sails/node_modules/socket.io/lib/namespace.js:214:9)
    at Object.broadcastToRoom [as broadcast] (/usr/local/lib/node_modules/sails/node_modules/sails-hook-sockets/lib/sails.sockets/broadcast-to-room.js:74:13)
    at child.broadcast (/usr/local/lib/node_modules/sails/lib/hooks/pubsub/index.js:139:23)
    at child.publishCreateSingle (/usr/local/lib/node_modules/sails/lib/hooks/pubsub/index.js:1218:14)
    at /usr/local/lib/node_modules/sails/lib/hooks/pubsub/index.js:1069:16
    at arrayEach (/usr/local/lib/node_modules/sails/node_modules/@sailshq/lodash/lib/index.js:1439:13)
    at Function.<anonymous> (/usr/local/lib/node_modules/sails/node_modules/@sailshq/lodash/lib/index.js:3500:13)
    at child.publishCreate (/usr/local/lib/node_modules/sails/lib/hooks/pubsub/index.js:1068:11)
    at child.wrapper [as publishCreate] (/usr/local/lib/node_modules/sails/node_modules/@sailshq/lodash/lib/index.js:3250:19)
    at created (/usr/local/lib/node_modules/sails/lib/hooks/blueprints/actions/create.js:48:19)
    at wrapper (/usr/local/lib/node_modules/sails/node_modules/lodash/index.js:3592:19)
    at applyInOriginalCtx (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/normalize.js:421:80)
    at wrappedCallback (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/normalize.js:324:18)
    at success (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/switchback/lib/normalize.js:33:31)
    at _switch (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/switchback/lib/factory.js:58:28)
    at /usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/query/dql/create.js:248:9
    at /usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:52:16
    at /usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:269:32
    at /usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:44:16
    at child.<anonymous> (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/schema.js:152:44)

Update:20-Dec-2017.. This is what i had gotten when in installed the >sails-mongo adapter...What exactly is the version 2.1.20 of..?

Faizaans-MacBook-Pro:foobar faiz$ npm install sails-mongo --save npm WARN deprecated mongodb@2.1.20: Please upgrade to 2.2.19 or higher + sails-mongo@0.12.2 added 14 packages in 7.967s


I couldn't figure out the exact issue here. I tried to connect my project to mysql and the same issue came up. The problem got solved when I created a new project and tried connecting it to the database.

链接地址: http://www.djcxy.com/p/33022.html

上一篇: 无法在PHP中执行节点模块

下一篇: Sailsjs:在使用mongodb创建蓝图后服务器崩溃