joy460154849 2017-09-18 06:57 采纳率: 0%
浏览 3308

[egg-mongoose] url is required on config

错误:
2017-09-18 14:35:11,901 INFO 1320 [master] egg version 1.8.0

assert.js:81
throw new assert.AssertionError({
^
AssertionError: [egg-mongoose] url is required on config
at module.exports.app (/Users/lixiuming/egg-example/node_modules/egg-mongoose/lib/mongoose.js:11:3)
at module.exports.agent (/Users/lixiuming/egg-example/node_modules/egg-mongoose/agent.js:4:28)
at AgentWorkerLoader.loadFile (/Users/lixiuming/egg-example/node_modules/egg-core/lib/loader/egg_loader.js:268:30)
at getLoadUnits.forEach.unit (/Users/lixiuming/egg-example/node_modules/egg-core/lib/loader/mixin/custom.js:33:29)
at Array.forEach (native)
at AgentWorkerLoader.loadCustomAgent (/Users/lixiuming/egg-example/node_modules/egg-core/lib/loader/mixin/custom.js:33:8)
at AgentWorkerLoader.load (/Users/lixiuming/egg-example/node_modules/egg/lib/loader/agent_worker_loader.js:21:10)
at new Agent (/Users/lixiuming/egg-example/node_modules/egg/lib/agent.js:25:17)
at Object. (/Users/lixiuming/egg-example/node_modules/egg-cluster/lib/agent_worker.js:22:15)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
2017-09-18 14:35:13,358 ERROR 1320 nodejs.AgentWorkerDiedError: [master] agent_worker#1:1321 died (code: 1, signal: null)
at Master.onAgentExit (/Users/lixiuming/egg-example/node_modules/egg-cluster/lib/master.js:289:17)
at emitOne (events.js:96:13)
at Master.emit (events.js:188:7)
at Messenger.sendToMaster (/Users/lixiuming/egg-example/node_modules/egg-cluster/lib/utils/messenger.js:122:17)
at Messenger.send (/Users/lixiuming/egg-example/node_modules/egg-cluster/lib/utils/messenger.js:87:12)
at ChildProcess.agentWorker.once (/Users/lixiuming/egg-example/node_modules/egg-cluster/lib/master.js:189:22)
at ChildProcess.g (events.js:292:16)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
name: 'AgentWorkerDiedError'
pid: 1320
hostname: lixiumingdeMacBook-Air.local

2017-09-18 14:35:13,359 ERROR 1320 [master] agent_worker#1:1321 start fail, exiting with code:1
2017-09-18 14:35:13,359 ERROR 1320 [master] exit with code:1
⚠️ Error: /Users/lixiuming/egg-example/node_modules/egg-bin/lib/start-cluster {"baseDir":"/Users/lixiuming/egg-example","framework":"/Users/lixiuming/egg-example/node_modules/egg","workers":1} exit with code 1
⚠️ Command Error, enable DEBUG=common-bin for detail

npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
npm ERR! node v6.11.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! example@1.0.0 dev: egg-bin dev
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the example@1.0.0 dev script 'egg-bin dev'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the example package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! egg-bin dev
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs example
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls example
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/lixiuming/egg-example/npm-debug.log

配置:
// {app_root}/config/plugin.js
exports.mongoose = {
enable: true,
package: 'egg-mongoose',
};

// /config/config.default.js
exports.mongoose = {
url: 'mongodb://@139.196.53.86:50000/otron',
options: {
user : "dba",
pass : "jEjU7!v6Dx",
auth : {authMechanism: 'SCRAM-SHA-1'}

}
};

  • 写回答

1条回答 默认 最新

  • 雪狼之夜 全栈领域优质创作者 2021-06-09 09:36
    关注

    你没配置config.default.js和  plugin.js 去看我这篇https://blog.csdn.net/xuelang532777032/article/details/116306479egg安装egg-mongoose 插件

    评论

报告相同问题?

悬赏问题

  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler