/opt/render/project/src/node_modules/bson/lib/bson.cjs:479
Nov 5 12:36:13 PM inspect ??= defaultInspect;
Nov 5 12:36:13 PM ^^^
Nov 5 12:36:13 PM
Nov 5 12:36:13 PM SyntaxError: Unexpected token '??='
Nov 5 12:36:13 PM at wrapSafe (internal/modules/cjs/loader.js:984:16)
Nov 5 12:36:13 PM at Module._compile (internal/modules/cjs/loader.js:1032:27)
Nov 5 12:36:13 PM at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
Nov 5 12:36:13 PM at Module.load (internal/modules/cjs/loader.js:933:32)
Nov 5 12:36:13 PM at Function.Module._load (internal/modules/cjs/loader.js:774:14)
Nov 5 12:36:13 PM at Module.require (internal/modules/cjs/loader.js:957:19)
Nov 5 12:36:13 PM at require (internal/modules/cjs/helpers.js:88:18)
Nov 5 12:36:13 PM at Object.<anonymous> (/opt/render/project/src/node_modules/mongodb/lib/bson.js:4:14)
Nov 5 12:36:13 PM at Module._compile (internal/modules/cjs/loader.js:1068:30)
i have change the run command like node index.js
or nodemon
index.js ==
start
"start" = "nodemon index.js"
"start" = "node index.js"
but still facing issue
2
Answers
I hope you are using Render. Render includes Node.js with a default version of 14.17.0. If you need to use a different Node.js version for your application, you can easily make this adjustment within the platform. To do so, navigate to your application’s environment settings on Render, and create an environment variable called
NODE_VERSION
. Set the value ofNODE_VERSION
to match the specific Node.js version that you have thoroughly tested with your application.Example:
NODE_VERSION
18.5
I faced same issue when I was trying to run docker container. Then I searched it on the internet. On the mongodb community chat one person has mentioned that if you will change mongoose version to "npm i [email protected]" then it would work. And then i remove my docker created image and changed mongosse version to 7.6.3. Again i created docker image of express server project which is connected with mongo cloud cluster and now it is working fine.