animetosho / Nyuu

Flexible usenet binary posting tool
224 stars 32 forks source link

After fresh install on a fresh Ubuntu 20.04: "Unexpected fatal exception encountered, stack trace below" ... Cannot find module './build/Release/yencode.node' #77

Closed sanderjo closed 4 years ago

sanderjo commented 4 years ago

I have problems installing nyuu on my Ubuntu 20.04. To rule out complex stuff, I just started a fresh Ubuntu 20.04 as a docker guest:

apt update
apt install npm -y
npm install -g nyuu
nyuu

leads to the below problems. Tips appreaciated.

root@3c739847f9ce:/# npm install -g nyuu
/usr/local/bin/nyuu -> /usr/local/lib/node_modules/nyuu/bin/nyuu.js

> yencode@1.1.1 install /usr/local/lib/node_modules/nyuu/node_modules/yencode
> node-gyp rebuild

OK, no errors so let's try:

root@3c739847f9ce:/# nyuu
[ERR ] Unexpected fatal exception encountered, stack trace below
/usr/local/lib/node_modules/nyuu/bin/nyuu.js:1056
        throw err; // this seems to change the exit code a bit :/
        ^

Error: Cannot find module './build/Release/yencode.node'
    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.<anonymous> (/usr/local/lib/node_modules/nyuu/node_modules/yencode/index.js:3:9)
    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)
root@3c739847f9ce:/# 

Ouch.

animetosho commented 4 years ago

The error suggests that the yencode module didn't build correctly.

I'm not sure if you've already done so, but if not, could you please try these two fixes, then do the npm install -g nyuu command?

sanderjo commented 4 years ago

Ah, same same as with parpar ... I wish I had thought of that. Sorry. As soon as I'm home again I'll try

animetosho commented 4 years ago

According to #76, --unsafe-perm might be all that you need. If so, it can be documented (#78) to hopefully help others.

sanderjo commented 4 years ago

According to #76, --unsafe-perm might be all that you need. If so, it can be documented (#78) to hopefully help others.

npm install -g nyuu --unsafe-perm works indeed (yencode is made and installed, I can call nyuu), in a fresh docker, as root (only user). I thought I had already tried that on my Ubuntu, but I'll retry once I'm home.

sanderjo commented 4 years ago

and ... update about my real machine: after some householding stuff (removing and reinstalling npm, hard-removing nyuu and yencode modules) ... nyuu works thanks to the npm install -g nyuu --unsafe-perm.

Thanks!

animetosho commented 4 years ago

Awesome, thanks for confirming!