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

我在config中配置了connections.js文件。 我使用快捷方式来检查数据是否存储在数据库中。 我把url localhost:1337 / test / create?name = hello它在数据库中创建一个条目,但是服务器崩溃了这个日志

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)

更新:2017年12月20日..这是我在安装> sails-mongo适配器时得到的东西...究竟是什么版本2.1.20 ..?

Faizaans-MacBook-Pro:foobar faiz $ npm install sails-mongo --save npm WARN弃用mongodb@2.1.20:请升级到2.2.19或更高版本+ sails-mongo@0.12.2在7.967s添加14个软件包


我无法弄清楚这里的确切问题。 我试图将我的项目连接到MySQL,并出现相同的问题。 当我创建一个新项目并尝试将它连接到数据库时,问题就解决了。

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

上一篇: Sailsjs: Server crash after using create blueprint with mongodb

下一篇: I am getting msg.trim is not a function when trying to start new app with ionic