Cannot find module nodemailer?

I’m trying to import my node.js file into render. on my local machine, I used npm install to install all required dependencies, and confirmed it was working locally using command “node server.js”. I uploaded this file to github, with only gitignore being my node_modules.

When attempting to run node server.js using the same command I used locally, I’m encountered with the following error:

Nodemailer is definitely in my package.json file, shown here:

{
“name”: “”,
“version”: “1.0.0”,
“description”: “”,
“main”: “server.js”,
“scripts”: {
“test”: “echo "Error: no test specified" && exit 1”,
“start”: “node server.js”
},
“keywords”: ,
“author”: “”,
“license”: “ISC”,
“dependencies”: {
“axios”: “^1.5.1”,
“axois”: “^0.0.1-security”,
“cors”: “^2.8.5”,
“dotenv”: “^16.3.1”,
“express”: “^4.18.2”,
“google-auth-library”: “^9.1.0”,
“googleapis”: “^128.0.0”,
“nodemailer”: “^6.9.6”
}
}

in render, my build command is node, which does work, and my start command is node server.js, as seen above.

Is there something I’m missing on render here that’s preventing it from working there?

Hi there,

Typically, MODULE_NOT_FOUND errors point to either a missing dependency or an incorrect build command. Have you tried changing the Build Command to npm install to ensure all the dependencies get installed?

Regards,
Mike


Render Support Engineer, MT (UTC-6)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.