Closed Shereef closed 2 years ago
@agutoli Please consider looking at this soon as it gets annoying having to make this change manually to my node_modules folder every deploy
Thanks!
I've implemented something a bit different which should solve your problem as well. Could you check this PR, please?
https://github.com/agutoli/serverless-layers/pull/84/files
custom:
serverless-layers:
packageManagerExtraArgs: '--ignore-scripts --option a --option b...'
I've created a new version serverless-layers@2.5.2-beta.0
in case you want to test this approach.
It doesn't work for me
[ LayersPlugin ]: => default
... ○ Downloading package.json from bucket...
... ○ Comparing package.json dependencies...
... ○ Changes identified ! Re-installing...
... ∅ [warning] ".npmrc" file does not exists!
... ∅ [warning] "yarn.lock" file does not exists!
✖ Stack daysmart-booking-service-sandbox failed to deploy (2s)
Environment: darwin, node 14.18.2, framework 3.1.1 (local), plugin 6.0.0, SDK 4.3.1
Credentials: Local, "sandbox" profile
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error:
Error: Command failed: npm
at checkExecSyncError (child_process.js:790:11)
at execSync (child_process.js:863:15)
at /Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/cli-progress-footer/lib/private/cli-progress-footer/disable-props.js:86:41
at handleSubProcessSync (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/cli-progress-footer/lib/private/cli-progress-footer/disable-props.js:30:36)
at childProcess.execSync (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/cli-progress-footer/lib/private/cli-progress-footer/disable-props.js:85:11)
at Dependencies._callee$ (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/serverless-layers/lib/package/Dependencies.js:80:26)
at tryCatch (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/regenerator-runtime/runtime.js:63:40)
at Generator.invoke [as _invoke] (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/regenerator-runtime/runtime.js:294:22)
at Generator.next (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/regenerator-runtime/runtime.js:119:21)
at asyncGeneratorStep (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
at /Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
at new Promise (<anonymous>)
at Dependencies.<anonymous> (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/@babel/runtime/helpers/asyncToGenerator.js:21:12)
at Dependencies.run (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/serverless-layers/lib/package/Dependencies.js:96:21)
at Dependencies._callee2$ (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/serverless-layers/lib/package/Dependencies.js:194:29)
at tryCatch (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/regenerator-runtime/runtime.js:63:40)
at Generator.invoke [as _invoke] (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/regenerator-runtime/runtime.js:294:22)
at Generator.next (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/regenerator-runtime/runtime.js:119:21)
at asyncGeneratorStep (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/Users/shereef.marzouk/Dev/daysmart-booking/service/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
I installed: "serverless-layers": "^2.5.2-beta.0",
There is another branch generously introduced by the author that does this better
Closing this PR
Some repos like one of mine has a
postinstall
script in mypackage.json
and causes it to throw exceptionsthis small change fixes that
Please review and thanks!