jrudess / streamdvr

DVR for streaming entertainment
GNU General Public License v3.0
68 stars 16 forks source link

Error: Cannot find module 'fs/promises' #155

Closed NeonStepZ closed 3 years ago

NeonStepZ commented 3 years ago

Sorry for bothering, I'm pretty new to this stuff and have no clue how to fix this error.

Error: Cannot find module 'fs/promises' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object. (/mnt/c/Users/NeonS/streamdvr-0.14.2/lib/core/postprocess.js:8:13) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3)``

jrudess commented 3 years ago

What version of node are you using? Can check with node --version. I believe that FS.promises became available starting with node v10.0, but am not certain.

NeonStepZ commented 3 years ago

I am using v14.17.6

jrudess commented 3 years ago

After cloning the repo did you also run npm install?

NeonStepZ commented 3 years ago

Yes I did. I will try cloning it again and see what happens or maybe try an older version?

jrudess commented 3 years ago

I'm using nodejs 16.9.1 here. Can you try editing lib/core/postprocess.js and make the following change.

At line 8, change: const fsp = require("fs/promises"); To: const fsp = require("fs").promises

It might still fail, but I'm looking to see if the stacktrace changes and the following line doesn't show up anymore:

at Object. (/mnt/c/Users/NeonS/streamdvr-0.14.2/lib/core/postprocess.js:8:13)
NeonStepZ commented 3 years ago

It's in a different directory this time but yea still same error I think.

internal/modules/cjs/loader.js:638

throw err;
^

Error: Cannot find module 'fs/promises' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object. (/mnt/d/streamdvr/lib/core/postprocess.js:8:13) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3)>

also when I try to do it in the windows command line it pulls up the TUI https://i.imgur.com/5ZH8xix.png

jrudess commented 3 years ago

At the moment, I don't have any other suggestions to try other than switching from the LTS version of node (14.7.6) to the latest version (16.9.1).

NeonStepZ commented 3 years ago

No problem thanks for trying!

jrudess commented 3 years ago

If you don't mind, can you send me the linux distribution and version you're using (as long as it's not windows + WSL)? I can install that distro in a VM and see if I can replicate the failure. That'll make it easier for me to fiddle around to find a solution.

NeonStepZ commented 3 years ago

Sorry it's windows + wsl.

jrudess commented 3 years ago

When you type "uname -r" in a shell, what do you get? I can probably still try to install that same version of Ubuntu in a VM and see if it reproduces the problem.

jrudess commented 3 years ago

Or if there is no 'uname' command, paste the contents of cat /etc/os-release

NeonStepZ commented 3 years ago

I got "4.4.0-19041-Microsoft"

jrudess commented 3 years ago

Ah, bummer. Looks like I won't be able to help debug further as I have no access to any Windows machines.

Rameenh commented 1 year ago

For anyone else experiencing this issue, I got past the error by downloading and using the latest version of nodejs v20.3.1 in Ubuntu 20.04.6 LTS for WSL