diff --git a/lib/commands/postinstall.js b/lib/commands/postinstall.js index 2dda20464..39bb46d9a 100644 --- a/lib/commands/postinstall.js +++ b/lib/commands/postinstall.js @@ -61,7 +61,7 @@ CMD.prototype.run = Promise.method(function() { return Promise.all([module, _this._saveCfTemplate(module.path)]); }) .spread(function(module) { - var deferredDepInstalls = []; + var deferredDepInstalls = [module]; switch (_this._packageManager) { case 'npm': @@ -80,8 +80,8 @@ CMD.prototype.run = Promise.method(function() { return Promise.all(deferredDepInstalls); }) - .then(function() { - return utils.findAllEnvVarsForAwsm(_this._JAWS._meta.projectRootPath, _this._moduleName); + .spread(function(module) { + return utils.findAllEnvVarsForAwsm(_this._JAWS._meta.projectRootPath, module.name); }) .then(function(envVars) { JawsCLI.log('Successfully installed ' + _this._moduleName);