2 joy460154849 joy460154849 于 2017.09.18 14:57 提问

[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'}

}
};

Csdn user default icon
上传中...
上传图片
插入图片