After running “nodemon server,” I got this error:
[nodemon] 2.0.15
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node server index.js`
internal/process/esm_loader.js:74
internalBinding('errors').triggerUncaughtException(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/brandonkim/Desktop/restaurant-reviews/backend/server.js' imported from /Users/brandonkim/Desktop/restaurant-reviews/backend/index.js
at finalizeResolution (internal/modules/esm/resolve.js:271:11)
at moduleResolve (internal/modules/esm/resolve.js:694:10)
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:805:11)
at Loader.resolve (internal/modules/esm/loader.js:88:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:241:28)
at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:72:40)
at link (internal/modules/esm/module_job.js:71:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
[nodemon] app crashed - waiting for file changes before starting...
What does this mean? How do I fix it? I am just simply trying to run the server for the backend of a website.
My package.json is:
{
"name": "backend",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.19.0",
"bson": "^4.2.2",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"mongodb": "^3.6.4"
}
}