Merge pull request #936 from arithmetric/feature/fix_install_link_error

Fixes 'file already exists' on install
This commit is contained in:
Eslam λ Hefnawy 2016-04-03 16:33:23 +07:00
commit 7745ca1c65

View File

@ -164,7 +164,7 @@ module.exports = function(S) {
.then(() => fse.copyAsync(S.getServerlessPath('templates', 'nodejs', 'package.json'), path.join(tmpDir, 'package.json')))
.then(() => BbPromise.fromCallback(cb => exec('npm install ' + projName, cb)))
.then(() => fse.moveAsync(path.join(tmpDir, 'node_modules', projName), path.join(userCwd, projName)))
.then(() => fse.moveAsync(path.join(tmpDir, 'node_modules'), path.join(userCwd, projName, 'node_modules')))
.then(() => fse.copyAsync(path.join(tmpDir, 'node_modules'), path.join(userCwd, projName, 'node_modules')))
.then(() => process.chdir(userCwd))
.then(() => fse.removeAsync(tmpDir));
}