diff --git a/lib/index.js b/lib/index.js index 1b286df7e..357a2a10f 100644 --- a/lib/index.js +++ b/lib/index.js @@ -151,16 +151,17 @@ class Embark { engine.logger.info(__("Ready").underline); engine.events.emit("status", __("Ready").green); }); - - engine.deployManager.deployContracts(function (err) { - engine.startService("fileWatcher"); - if (options.runWebserver) { - engine.startService("webServer", { - host: options.serverHost, - port: options.serverPort - }); - } - callback(err); + engine.events.on('engine-ready', function () { + engine.deployManager.deployContracts(function (err) { + engine.startService("fileWatcher"); + if (options.runWebserver) { + engine.startService("webServer", { + host: options.serverHost, + port: options.serverPort + }); + } + callback(err); + }); }); } ], function (err, _result) {