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

Running claudia create with expressjs api results in Error: Cannot find module '{module}' #242

Open
flatypus opened this issue Feb 9, 2023 · 0 comments

Comments

@flatypus
Copy link

flatypus commented Feb 9, 2023

  • Expected behaviour:
    I set up a pretty large api that I'm hoping to run on lambda with claudia. After running the two commands, I get issues like module cors could not be found and when use '--use-local-dependencies' I get errors like Error: Cannot find module 'aws-serverless-express'. I tried to simplify the project to the most simple express app as I could, but even then, I got a
Error: Cannot find module 'C:\Users\hchan\AppData\Local\Temp\YwdKl4\api-1.0.0-4zzeGN\package\lambda'
Require stack:
C:\Users\hchan\AppData\Roaming\nvm\v18.12.1\node_modules\claudia\src\tasks\validate-package.js
C:\Users\hchan\AppData\Roaming\nvm\v18.12.1\node_modules\claudia\src\commands\create.js
C:\Users\hchan\AppData\Roaming\nvm\v18.12.1\node_modules\claudia\src\util\read-commands.js
C:\Users\hchan\AppData\Roaming\nvm\v18.12.1\node_modules\claudia\bin\cmd.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at validatePackage (C:\Users\hchan\AppData\Roaming\nvm\v18.12.1\node_modules\claudia\src\tasks\validate-package.js:16:15)
    at C:\Users\hchan\AppData\Roaming\nvm\v18.12.1\node_modules\claudia\src\commands\create.js:370:10
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
cannot require ./lambda after clean installation. Check your dependencies.

error.

I ran
claudia generate-serverless-express-proxy --express-module dist/_server
and
claudia create --handler lambda.handler --deploy-proxy-api --region us-west-2

@flatypus flatypus changed the title Running claudia create results in Error: Cannot find module '{module}' Running claudia with expressjs create results in Error: Cannot find module '{module}' Feb 9, 2023
@flatypus flatypus changed the title Running claudia with expressjs create results in Error: Cannot find module '{module}' Running "claudia with expressjs create results in Error: Cannot find module '{module}' Feb 9, 2023
@flatypus flatypus changed the title Running "claudia with expressjs create results in Error: Cannot find module '{module}' Running "claudia create" with expressjs api results in Error: Cannot find module '{module}' Feb 9, 2023
@flatypus flatypus changed the title Running "claudia create" with expressjs api results in Error: Cannot find module '{module}' Running claudia create with expressjs api results in Error: Cannot find module '{module}' Feb 9, 2023
@flatypus flatypus changed the title Running claudia create with expressjs api results in Error: Cannot find module '{module}' Running claudia create with expressjs api results in Error: Cannot find module '{module}' Feb 9, 2023
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

1 participant