Reputation: 719
I am trying to deploy angular web app on AWS serverless Lambda following the tutorial https://medium.com/better-programming/getting-started-with-serverless-angular-universal-on-aws-lambda-8754bcc4dc19
It was working fine till last week, but started to throw error "Error: Cannot find module '@vendia/serverless-express'" even though there is no mention of '@vendia/serverless-express' anywhere. The generated lambda.js uses'aws-serverless-express'.
Installed '@vendia/serverless-express' through npm, it got added to package.json. Deployed post that, still error is reported.
Steps to reproduce:
Let me know in case of any further information required. Thanks in advance!
Upvotes: 6
Views: 2284
Reputation: 588
aws-serverless-express has rebranded to @vendia/serverless-express. The new path is not yet included in ng-toolkit's serverless-aws.yml file and that is what is causing the issue.
Adding the following in the serverless.yml excludes would solve the issue.
- '!node_modules/@vendia/**'
End result would be something like
package:
exclude:
- src/**
- node_modules/**
- firebug-lite/**
- e2e/**
- coverage/**
- '!node_modules/@vendia/**'
- '!node_modules/aws-serverless-express/**'
- '!node_modules/binary-case/**'
- '!node_modules/type-is/**'
- '!node_modules/media-typer/**'
- '!node_modules/mime-types/**'
- '!node_modules/mime-db/**'
Upvotes: 13