Error: Cannot find module: math-intrinsics

Hi everyone,
I’m facing an issue while deploying my Node.js app on Render. The deployment fails with the following error: Error: Cannot find module ‘/opt/render/project/src/node_modules/math-intrinsics/floor.js’
However, my package.json does include this module, so I’m not sure why it’s not being found.

What I’ve tried:

• Checked that math-intrinsics is listed in package.json.
• Tried redeploying after running npm install locally.
• Verified that the correct Node.js version (22.x) is being used.
This is my package.json:
{
“scripts”: {
“build”: “npm install”,
“start”: “node app.js”,
“dev”: “nodemon app.js”,
“test”: “echo "Error: no test specified" && exit 1”
},
“dependencies”: {
“bcryptjs”: “^3.0.2”,
“cloudinary”: “^1.41.3”,
“cors”: “^2.8.5”,
“dotenv”: “^16.4.7”,
“express”: “^4.21.2”,
“http-errors”: “^2.0.0”,
“jsonwebtoken”: “^9.0.2”,
“math-intrinsics”: “^1.1.0”,
“mongoose”: “^8.10.0”,
“morgan”: “^1.10.0”,
“multer”: “^1.4.5-lts.1”,
“multer-storage-cloudinary”: “^4.0.0”,
“nodemon”: “^3.1.9”,
“qs”: “^6.14.0”,
“stripe”: “^17.7.0”
},
“engines”: {
“node”: “22.x”
}
}
and this is the error in render:
Error: Cannot find module ‘/opt/render/project/src/node_modules/math-intrinsics/floor.js’

Mar 12 11:09:03 AM at createEsmNotFoundErr (node:internal/modules/cjs/loader:1261:15)

Mar 12 11:09:03 AM at finalizeEsmResolution (node:internal/modules/cjs/loader:1250:15)

Mar 12 11:09:03 AM at resolveExports (node:internal/modules/cjs/loader:639:14)

Mar 12 11:09:03 AM at Function._findPath (node:internal/modules/cjs/loader:728:31)

Mar 12 11:09:03 AM at Function._resolveFilename (node:internal/modules/cjs/loader:1211:27)

Mar 12 11:09:03 AM at Function._load (node:internal/modules/cjs/loader:1055:27)

Mar 12 11:09:03 AM at TracingChannel.traceSync (node:diagnostics_channel:322:14)

Mar 12 11:09:03 AM at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)

Mar 12 11:09:03 AM at Module.require (node:internal/modules/cjs/loader:1311:12)

Mar 12 11:09:03 AM at require (node:internal/modules/helpers:136:16) {

Mar 12 11:09:03 AM code: ‘MODULE_NOT_FOUND’,

Mar 12 11:09:03 AM path: ‘/opt/render/project/src/node_modules/math-intrinsics’

Mar 12 11:09:03 AM}

What is your build command set to?

npm install

Ok, so here’s what I’d check.

  • The build command for the service in the Render dashboard is doing npm install
  • That you’ve not committed node_modules to your repo
  • if all else fails, use the manual deploy button and ‘clear cache’ to start from scratch.

Thank you Jhon!! I think it was a cache problem, finally deployed :blush:

1 Like