Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'serverless/lib/plugins/aws/package/compile/events/api-gateway/lib/rest-api' #170

Open
wanjohiryan opened this issue Apr 15, 2022 · 2 comments

Comments

@wanjohiryan
Copy link

wanjohiryan commented Apr 15, 2022

I keep getting this error while trying to deploy.

Error ---------------------------------------------------

Error: Cannot find module 'serverless/lib/plugins/aws/package/compile/events/api-gateway/lib/rest-api'
Require stack:

  • C:\Projects\qwant\node_modules\serverless-apigateway-service-proxy\lib\index.js
  • C:\Users\User\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js
  • C:\Users\User\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js
  • C:\Users\User\AppData\Roaming\npm\node_modules\serverless\scripts\serverless.js
  • C:\Users\User\AppData\Roaming\npm\node_modules\serverless\bin\serverless.js
@dabrady
Copy link

dabrady commented Aug 10, 2022

@wanjohiryan I'm getting the same error. A quick googling shows a similar issue with users of a different plugin: the root cause was identified as an implicit dependency on having the serverless package specified as a dev dependency of the project:

functionalone/serverless-iam-roles-per-function#1

By adding serverless as a dev dependency of my project, I was able to resolve this error and deploy.

@brettdh
Copy link

brettdh commented Aug 27, 2024

This issue has bitten me today after attempting to upgrade to Serverless v4, as the serverless/lib directory is no longer available to require().

I'll probably submit a PR once I figure out the right patch... though this project has been quiet for a looong time 😬

Decided to go directly to Cloudfront+S3 instead as in this example: https://github.com/aws-samples/amazon-cloudfront-secure-static-site

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants