I'm encountering a problem in my development environment where the Catalyst Function is logging an error stating "Express module not found". However, I've verified that Express is installed on my system. What might be causing this issue?
This seems to work fine during local debugging using $ catalyst serve
command. I have added the screenshot where logs state that express is not found.
You have faced this issue if you have not installed the express module inside your function folder. Catalyst, while running locally, takes the express module from the local system. However, while deployed, the node modules folder must contain express for the function to work properly.
To address this issue, I recommend navigating to your function directory (functions/{your function name}) and executing the command npm install express
to install the express module within your function. Following this, you can proceed to deploy the function and test it by running the command catalyst deploy