我正在尝试首次安装node / mongo应用程序,特别是https://github.com/nature/pa11y-dashboard到我的Digital Ocean Ubuntu Droplet上的虚拟主机。
我已经成功安装了所有依赖项,但我不确定MongoDb配置。在/ config目录中有一个development.json示例,说明似乎意味着可以在本地使用。
{
"port": 4000,
"noindex": true,
"readonly": false,
"webservice": {
"database": "mongodb://localhost/pa11y-webservice-dev",
"host": "0.0.0.0",
"port": 3000,
"cron": "0 30 0 * * *"
}
}
运行NODE_ENV=development nodejs .
会输出以下错误。
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
pa11y-dashboard started
mode: development
uri: http://0.0.0.0:4000
pa11y-webservice started
mode: development
uri: http://0.0.0.0:3000
/var/www/website.com/public/node_modules/pa11y-webservice/node_modules/mongodb/lib/mongodb/connection/base.js:242
throw message;
^
TypeError: undefined is not a function
at __executeInsertCommand (/var/www/website.com/public/node_modules/pa11y-webservice/node_modules/mongodb/lib/mongodb/db.js:1829:12)
at Db._executeInsertCommand (/var/www/website.com/public/node_modules/pa11y-webservice/node_modules/mongodb/lib/mongodb/db.js:1930:5)
at /var/www/website.com/public/node_modules/pa11y-webservice/node_modules/mongodb/lib/mongodb/db.js:1442:27
at /var/www/website.com/public/node_modules/pa11y-webservice/node_modules/mongodb/lib/mongodb/db.js:1560:7
at /var/www/website.com/public/node_modules/pa11y-webservice/node_modules/mongodb/lib/mongodb/cursor.js:162:16
at commandHandler (/var/www/website.com/public/node_modules/pa11y-webservice/node_modules/mongodb/lib/mongodb/cursor.js:706:16)
at /var/www/website.com/public/node_modules/pa11y-webservice/node_modules/mongodb/lib/mongodb/db.js:1806:9
at Server.Base._callHandler (/var/www/website.com/public/node_modules/pa11y-webservice/node_modules/mongodb/lib/mongodb/connection/base.js:442:41)
at /var/www/website.com/public/node_modules/pa11y-webservice/node_modules/mongodb/lib/mongodb/connection/server.js:485:18
at MongoReply.parseBody (/var/www/website.com/public/node_modules/pa11y-webservice/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
查看Mongo shell没有显示pa11y-webservice-dev的数据库,但是从我读到的内容看起来是典型的,直到将数据推送到那里。
非常感谢任何有关此设置的帮助!