Skip to content
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

Can't import "mysql2/promise" into ES module (MJS) on Node.js 13.12/14.00 #1114

Closed
pubmikeb opened this issue Mar 28, 2020 · 2 comments
Closed

Comments

@pubmikeb
Copy link

I'm trying to convert my project from CommonJS (CJS) to ES Module (MJS), to do that I use:

import mysqlPromise from "mysql2/promise";

But then I get an error:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Users\User\IdeaProjects\…\node_modules\mysql2\promise' imported from…

Then I found a recently closed thread on the Node.js Github, where it's written «Closing as this is by design.»

Is it possible to provide mysql2/promise in MJS-friendly mode to be able to easily import mysql2/promise?

@simi
Copy link
Contributor

simi commented Mar 28, 2020

Seems you have reported issue to wrong repo. This is mysql2 rubygem repo. You're looking probably for mysql2 node package repo, which is hosted at https://github.com/sidorares/node-mysql2.

@pubmikeb
Copy link
Author

pubmikeb commented Mar 28, 2020

@simi, opps. You're right! Sorry.
The correct thread: sidorares/node-mysql2#1093

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants