mayudev / revcord

A bridge for Discord and Revolt with easy setup through commands
MIT License
64 stars 9 forks source link

ERR_MODULE_NOT_FOUND #12

Closed timahey closed 1 year ago

timahey commented 1 year ago

Hello, when using the npm start command, an error ERR_MODULE_NOT_FOUND occurs.

image

Any ideas how to fix it?

mayudev commented 1 year ago

did you run npm install and npm run build?

timahey commented 1 year ago

Yes

mayudev commented 1 year ago

I am not sure what its caused by then, maybe try cloning the repo again and doing everything from the beginning

timahey commented 1 year ago

Just did it all over again. But again the same error. I also noticed that when npm install warning npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs is displayed, maybe an error occurs because of it? image

mayudev commented 1 year ago

no, it is very unlikely to be caused by that since it is only a warning This might be a Windows-specific issue since I cannot reproduce it on Linux, I will try it tomorrow on a virtual machine

mayudev commented 1 year ago

Okay, I was actually able to accidentally reproduce this issue. It seems I'm getting an identical output while omitting the --experimental-specifier-resolution=node part, but I'm using an older version of node. I believe this parameter was removed in node v19, which causes the issue. A temporary solution would be to use Node version 18 or older. I am going to look for an actual solution tomorrow.

timahey commented 1 year ago

Okay, thanks for the answer

mayudev commented 1 year ago

It turns out the fix was pretty easy, I just had to configure tsc to emit commonjs modules, and so it works without any experimental loader. I probably thought that method was outdated, but since the nodejs ecosystem is a mess it is still the only way to have things working on most versions. (https://github.com/mayudev/revcord/commit/03cdd6fd0fc82b17a26557904e9434b9c930be3e) I briefly tested it in node 16, 18 and 20 and everything seems to be working properly now.