From fa2088808bb4f40ba65ba593cfd431b59d597ae0 Mon Sep 17 00:00:00 2001 From: Andrew McDonald Date: Mon, 15 Aug 2016 11:41:22 -0700 Subject: [PATCH 1/3] fix #1860 - Cannot find module for any node_modules When running on windows, 'UNIX' was incorrectly being passed into jszip as the host platform which causes it to generate a zip file which lambda doesn't unpack properly. ( I think its the \ vs / thing - the zip file looks correct when I open it in a gui tool, but using unpack unpacks a bunch of files with '\' in the filename and no actual folder structure ) --- lib/plugins/package/lib/zipService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins/package/lib/zipService.js b/lib/plugins/package/lib/zipService.js index 11a8e7673..73040444d 100644 --- a/lib/plugins/package/lib/zipService.js +++ b/lib/plugins/package/lib/zipService.js @@ -51,7 +51,7 @@ module.exports = { } }); - const platformName = ['UNIX', 'DOS'].indexOf(process.platform) !== -1 ? process.platform : + const platformName = ['UNIX', 'DOS', 'win32'].indexOf(process.platform) !== -1 ? process.platform : 'UNIX'; return zip.generateAsync({ From 391f1c2bb7cfbc28caff3e201ae0957503662176 Mon Sep 17 00:00:00 2001 From: Andrew McDonald Date: Mon, 15 Aug 2016 11:50:21 -0700 Subject: [PATCH 2/3] Bringing line length under 100 due to lint issue --- lib/plugins/package/lib/zipService.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/plugins/package/lib/zipService.js b/lib/plugins/package/lib/zipService.js index 73040444d..ae55d6593 100644 --- a/lib/plugins/package/lib/zipService.js +++ b/lib/plugins/package/lib/zipService.js @@ -51,8 +51,8 @@ module.exports = { } }); - const platformName = ['UNIX', 'DOS', 'win32'].indexOf(process.platform) !== -1 ? process.platform : - 'UNIX'; + const platformName = ['UNIX', 'DOS', 'win32'].indexOf(process.platform) !== -1 ? + process.platform : 'UNIX'; return zip.generateAsync({ type: 'nodebuffer', From 0f2659c5a3af6a40b8fbf60f527e75c6ac5b6c27 Mon Sep 17 00:00:00 2001 From: Andrew McDonald Date: Mon, 15 Aug 2016 12:39:28 -0700 Subject: [PATCH 3/3] Fixing trailing space npm test isn't working at all for me. ( windows ) --- lib/plugins/package/lib/zipService.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins/package/lib/zipService.js b/lib/plugins/package/lib/zipService.js index ae55d6593..2cf70b8d0 100644 --- a/lib/plugins/package/lib/zipService.js +++ b/lib/plugins/package/lib/zipService.js @@ -51,7 +51,7 @@ module.exports = { } }); - const platformName = ['UNIX', 'DOS', 'win32'].indexOf(process.platform) !== -1 ? + const platformName = ['UNIX', 'DOS', 'win32'].indexOf(process.platform) !== -1 ? process.platform : 'UNIX'; return zip.generateAsync({