Skip to content
This repository has been archived by the owner on Nov 3, 2018. It is now read-only.

Config file can't be generated #50

Open
1sudo opened this issue Mar 5, 2016 · 3 comments
Open

Config file can't be generated #50

1sudo opened this issue Mar 5, 2016 · 3 comments
Labels
Milestone

Comments

@1sudo
Copy link

1sudo commented Mar 5, 2016

I'm getting the following error when running the latest release. As you can see below, my node version is up to date. I can go into DiscordJS.js and comment out the following:

function initDecoders() {
// if(!Utils.exists(config['decoder-path'])) {
Utils.registerDecoder(new DiscordDJ.FFmpegDecoder(null));
// } else {
// Utils.registerDecoder(new DiscordDJ.FFmpegDecoder(config['decoder-path']));
// }
Utils.registerDecoder(new DiscordDJ.ChiptuneDecoder());
}

This allows the bot to start but when I play a song with !yt it says "You were added to the wait list and your track was set" and no song plays.

Any idea what's going on?

root@msg:~/bot/DiscordDJ-0.0.5# node -v
v5.7.1

root@msg:/bot/DiscordDJ-0.0.5# ls
LICENSE lib runtime setup-bot.sh start-bot.sh
README.md package.json setup-bot.bat start-bot.bat
root@msg:
/bot/DiscordDJ-0.0.5# ./setup-bot.sh

NPM is installed!
Installing dependencies (that can take a while)

Dependencies are installed.

Now, you can start the bot.
We will help you configure the basic information

Run the bot now? [Y/N] y

[email protected] start /root/bot/DiscordDJ-0.0.5
node ./runtime/DiscordDJ.js

/root/bot/DiscordDJ-0.0.5/runtime/DiscordDJ.js:33
if(!Utils.exists(config['decoder-path'])) {
^

TypeError: Cannot read property 'decoder-path' of null
at initDecoders (/root/bot/DiscordDJ-0.0.5/runtime/DiscordDJ.js:33:28)
at Object. (/root/bot/DiscordDJ-0.0.5/runtime/DiscordDJ.js:324:1)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:141:18)
at node.js:933:3

npm ERR! Linux 4.2.6-1-pve
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.7.1
npm ERR! npm v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node ./runtime/DiscordDJ.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node ./runtime/DiscordDJ.j s'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the discord-dj package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./runtime/DiscordDJ.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs discord-dj
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls discord-dj
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /root/bot/DiscordDJ-0.0.5/npm-debug.log

@Guichaguri Guichaguri added the bug label Mar 5, 2016
@Guichaguri Guichaguri added this to the v0.0.6 milestone Mar 7, 2016
This was referenced Mar 15, 2016
@philno
Copy link

philno commented Mar 16, 2016

So there is an easy fix for this: Create "config.json" as an empty file / put "{}" in it and the installation dialog will apear as expected.

Btw: @Guichaguri :You "deleted" my issue and use the generic-title one instead? I usually check issues before I open a new one, but "error" or "didnt work" is not as useful...

@Guichaguri Guichaguri changed the title Error after v0.05 Config file can't be generated Mar 16, 2016
@Guichaguri
Copy link
Owner

@BitRape Sorry, I changed the title =P

@ghost
Copy link

ghost commented Oct 20, 2017

philno's fix is useful if you start setup-bot.sh without permissions or something went wrong and you get "TypeError: Cannot read property 'decoder-path' of null"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants