-
-
Notifications
You must be signed in to change notification settings - Fork 622
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
I can not import * as mysql from 'mysql2' in typescript #619
Comments
there are typings available at https://github.com/types/npm-mysql2 , see #482 (comment) is that enough to fix your issue? |
Hi @sidorares, thank you so much!
|
ping @felixfbecker |
@mamingzhi does work for you: typings/registry#778 (comment)? |
@sidorares
my typescript version does not support the |
Sorry, the new way should be " |
sorry, I have very little practical experience with typescript and related tools. If you need any change from library side to make it easier to integrate let me know (but please explain what change required) |
@mamingzhi I cannot reproduce your error, I have no problem installing the typings. with npm 5 (supports
with npm 4
The errors you posted indicate that you tried to install Not sure what you are referring to with "the new way". |
I think he refers to the fact that now either you publish @types/mysql2 to the Types repo or the mantainers of the repo should add a .d.ts file with the defined types in the root folder of the project. |
...or you install typings from the @types or from GitHub. Contributing to DT is cumbersome. Waiting for microsoft/types-publisher#4 |
Hi @felixfbecker, Thank you for your reply, This moring, I tried it again,
The new way I mentioned is, I tried the " I also tried the " https://stackoverflow.com/questions/39261204/typings-vs-types-npm-scope |
Sorry, I think I get the root cause "there is an issue for my git." but I hope I can use " thanks a lot. |
Hi node-mysql2 team,
Could you please add the declaration file for module 'node-mysql2'? Currently, I can not find the declaration. so I have to use the
"require"
to load 'node-mysql2'. Howerver, the project tslint rule ask us for "import * as mysql from 'mysql2'
".Since node-mysql2 is so popular, I hope, node-mysql2 will support typescript for type checking in the future.
Thanks a lot.
Mike
The text was updated successfully, but these errors were encountered: