SpaghettDev / Economy-Bot

A discord.js economy bot.
MIT License
58 stars 60 forks source link

parse-ms does not work with require() #13

Open dionsyran2 opened 3 years ago

dionsyran2 commented 3 years ago

Hello, I realized that parse-ms cannot be included with require() As i get this error

import parseMilliseconds from 'parse-ms' ^^^^^^

SyntaxError: Cannot use import statement outside a module

Thats why i used the source code from parse-ms to create parse-ms-2, https://www.npmjs.com/package/parse-ms-2 All the source is in github (https://github.com/dionsyran2/parse-ms-2), so you can have a look and make sure i am not giving you a virus or something.

Thanks for reading

Have a nice day, dionsyran2

LoopyChimp commented 3 years ago

Hey! Change require to import and i find it works just fine!

dionsyran2 commented 3 years ago

Hey! Change require to import and i find it works just fine!

only that you need to change my project to module to use import, but if i do i cannot use require or import other modules, because they only work with require()

LoopyChimp commented 3 years ago

hmm, sometimes it doesnt require you to have require for all of them, i changed all my requires to import. clone your files to a new folder and try that.