-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Express.js Module Resolution Errors: Missing Internal Modules Not Utilized in Project #6227
Comments
Just to confirm, you're using Express with ES modules, in a .js file, and in the package.json you don't have the type set to module? { //package.json
"type": "module"
} note: As far as I know, in the latest version of Node.js 22.12, where CJ modules can be resolved in ES modules, there are issues with libraries that use monkey patching. This will be fixed in the next version of Node.js. I'm on my phone right now, so I can provide links for this later. |
Could you share more context about your project structure and package.json? |
Thank you for providing some insights into the issue. To clarify, I am creating a new boilerplate HTTP server that essentially serves as a "Hello World" application. Here are the details of my setup and the steps I've taken:
Steps Taken So Far:
|
Hello Express Community,
I've been encountering persistent issues with my Express.js application that I haven't been able to resolve despite numerous troubleshooting attempts. Below are the details of the problems and the steps I've taken so far.
Environment:
Node.js Version: v22.12.0
Express.js Version: latest
Operating System: Windows 11
Issues Encountered:
1: Error When Running node index.js:
2: Error When Using Nodemon (npm start):
Steps Taken to Resolve:
Reinstalled node_modules: Deleted the node_modules folder and ran npm install multiple times.
Reinstalled Node.js: Completely removed Node.js and installed the latest version.
Tried Alternative Package Managers: Switched between npm, Yarn, and pnpm without success.
Tested with Other Frameworks: Created simple boilerplate projects using Fastify and NestJS, which run without issues.
Used Different Boilerplates: Even with a fresh Express boilerplate, the same errors persist.
Additional Information:
The issue persists even with a fresh Express setup.
Other Node.js frameworks like Fastify and NestJS work flawlessly on the same environment.
Suspect it might be related to Express's internal modules or compatibility with the current Node.js version.
.
Request for Assistance:
Has anyone encountered similar issues with Express.js, particularly related to missing internal modules like ./middleware/query or brace-expansion? Any insights or suggestions on how to resolve these module resolution errors would be greatly appreciated.
Thank you in advance for your help!
The text was updated successfully, but these errors were encountered: