make a simple website for noman mohammad web dev and add function for notification and…
- User
make a simple website for noman mohammad web dev and add function for notification and make an separate admin page where admin can see allowed users and send them notification
- Assistant
- User
const type = getNearestParentPackageJSONType(mainPath); ^
Error: Invalid package config /Users/noman/Desktop/python/noman/package.json. at shouldUseESMLoader (node:internal/modules/run_main:91:16) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:163:20) at node:internal/main/run_main_module:36:49 { code: 'ERR_INVALID_PACKAGE_CONFIG' }
Node.js v23.1.0
- Assistant
- User
Error: Cannot find module 'ejs' Require stack:
- /Users/noman/Desktop/python/noman/node_modules/express/lib/view.js
- /Users/noman/Desktop/python/noman/node_modules/express/lib/application.js
- /Users/noman/Desktop/python/noman/node_modules/express/lib/express.js
- /Users/noman/Desktop/python/noman/node_modules/express/index.js
- /Users/noman/Desktop/python/noman/server.js at Function._resolveFilename (node:internal/modules/cjs/loader:1246:15) at Function._load (node:internal/modules/cjs/loader:1072:27) at TracingChannel.traceSync (node:diagnostics_channel:322:14) at wrapModuleLoad (node:internal/modules/cjs/loader:216:24) at Module.require (node:internal/modules/cjs/loader:1337:12) at require (node:internal/modules/helpers:139:16) at new View (/Users/noman/Desktop/python/noman/node_modules/express/lib/view.js:81:14) at Function.render (/Users/noman/Desktop/python/noman/node_modules/express/lib/application.js:587:12) at ServerResponse.render (/Users/noman/Desktop/python/noman/node_modules/express/lib/response.js:1049:7) at /Users/noman/Desktop/python/noman/server.js:17:9
- Assistant
The error you're encountering, "Cannot find module 'ejs'," indicates that the EJS module is not installed in your project directory, and thus, Node.js cannot locate it. EJS is a popular templating engine for rendering HTML in Express applications. Let's resolve this issue step-by-step:
Steps to Resolve
-
Install EJS:
-