Can't require packages
Fusl opened this issue · 2 comments
Fusl commented
Hi,
when obfuscating my script which works pretty well, this is what happens:
fusl@thinkbook:~/nodecast> ./transcoder2.js < transcoder.json
/home/fusl/nodecast/transcoder2.js:2
a("\x2e\x2f"+c.basename(b));if(d=c.resolve(b),e=c.cache[d],!e)throw Error('fai
^
Error: failed to require "./functions.js"
at Error (<anonymous>)
at c (/home/fusl/nodecast/transcoder2.js:2:160)
at b (/home/fusl/nodecast/transcoder2.js:2:735)
at Object.<anonymous> (/home/fusl/nodecast/transcoder2.js:2:986)
at c (/home/fusl/nodecast/transcoder2.js:2:229)
at /home/fusl/nodecast/transcoder2.js:2:15340
at Object.<anonymous> (/home/fusl/nodecast/transcoder2.js:2:15406)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
And this is what it should look like:
fusl@thinkbook:~/nodecast> ./transcoder.js < transcoder.json
27 Nov 13:13:26 - Spawning mount(/main-192.mp3)
27 Nov 13:13:26 - Spawning mount(/main-192.mp3)
27 Nov 13:13:26 - Spawning mount(/main-128.mp3)
27 Nov 13:13:26 - Spawning mount(/main-128.mp3)
27 Nov 13:13:26 - Spawning mount(/main-128.aac)
27 Nov 13:13:26 - Spawning mount(/main-128.aac)
27 Nov 13:13:26 - Spawning mount(/main-64.aac)
27 Nov 13:13:26 - Spawning mount(/main-64.aac)
27 Nov 13:13:26 - Spawning source(dj)
27 Nov 13:13:26 - Spawning source(playlist)
27 Nov 13:13:26 - Spawning source(silence)
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:901:11)
at Server._listen2 (net.js:1039:14)
at listen (net.js:1061:10)
at net.js:1135:9
at dns.js:72:18
at process._tickCallback (node.js:415:13)
// Edit:
I compiled with
obfuscator --out transcoder3.js --strings --entry transcoder2.js ./transcoder2.js
stephenmathieson commented
you need to include all of your scripts, not just the entry point. for example:
obfuscator --out transcoder3.js --strings --entry transcoder2.js ./transcoder2.js ./functions.js ./lib/*.js
Fusl commented
Okay, that worked for me. Thanks!