From 71f76e1161cbe9bc820d4913450cc8e8090ad5ef Mon Sep 17 00:00:00 2001 From: Joe Turgeon Date: Fri, 1 Apr 2016 16:42:17 -0500 Subject: [PATCH] Using copy instead of move to avoid 'EEXIST: file already exists' error due to the preceding move operation. --- lib/actions/ProjectInstall.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/actions/ProjectInstall.js b/lib/actions/ProjectInstall.js index a9527712f..5b0870e49 100644 --- a/lib/actions/ProjectInstall.js +++ b/lib/actions/ProjectInstall.js @@ -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)); }