Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Commander Lvl 3
Message 11 of 42

Re: I need help with bot making on Discord.

First of all, I just noticed you probably publicly posted your Discord API token up above please make sure to request a new one from Discord.

 

Okay, so we now have established that your PATH is correcly set, Node is correctly installed and your developed app should work fine.

 

If you just forget the last part of my message, can you describe where exactly you’re stuck now? Still the same error as your initial post? 


- Mark
Copilot Lvl 3
Message 12 of 42

Re: I need help with bot making on Discord.

The token was updated. But now everytime I try doing 'node .' within Visual Studio Code, the terminal just technically skips it and does nothing. With no response from the bot and still not going online. And I still don't know what's wrong with it at this point. 

Ground Controller Lvl 1
Message 13 of 42

Re: I need help with bot making on Discord.

et a npm ERR

npm ERR! file C:\Users\HP\Desktop\DiscordBot\package.json
npm ERR! code EJSONPARSE
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token b in JSON at position 101 while parsing near '...and fun.",
npm ERR! JSON.parse "main": bot.js",
npm ERR! JSON.parse "dependenc...'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs\2019-05-05T04_05_47_665Z-debug.log

Any suggestions? I also did try the holding shift then right click to open CMD< but it doesn't work or I'm just blind. 

 


@DemonWolfFang wrote:

Hey!! I'm new here. So I tried making a discord bot but its hard for a first timer. Everytime I do 

npm install discord.io winston -save

I always get a npm ERR

npm ERR! file C:\Users\HP\Desktop\DiscordBot\package.json
npm ERR! code EJSONPARSE
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token b in JSON at position 101 while parsing near '...and fun.",
npm ERR! JSON.parse "main": bot.js",
npm ERR! JSON.parse "dependenc...'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs\2019-05-05T04_05_47_665Z-debug.log

Any suggestions? I also did try the holding shift then right click to open CMD< but it doesn't work or I'm just blind. 

 

 


 

Copilot Lvl 3
Message 14 of 42

Re: I need help with bot making on Discord.

Ok and I said everything was updated using Visual Studio Code and not Notepad++. In Visual Studio Code I'm having no erros, but the bot just doesn't want to start everytime I do 'node .' and just does absolutely nothing but go to a new command. Couldn't it be a line error or a wrong command I'm doing? 

Highlighted
Commander Lvl 3
Message 15 of 42

Re: I need help with bot making on Discord.

@DemonWolfFang what if you try running node bot.js (or node app.js if your file is called app.js instead of bot.js)? Do you get the inital error back, or does it run? If you do, check this thread out to see if you can get it resolved: https://stackoverflow.com/questions/24920142/package-json-must-be-actual-json-not-just-javascript

 

@ceckin6 That looks pretty similar! Have you tried some of the solutions in this topic already? You could also check out the link I posted above for @DemonWolfFang . Finally, it might be helpful to post your package.json (using a GitHub Gist (https://gist.github.com/) for example).


- Mark
Copilot Lvl 3
Message 16 of 42

Re: I need help with bot making on Discord.

Its just the issue where  I run 

node .

But it does nothing. 

 

Commander Lvl 3
Message 17 of 42

Re: I need help with bot making on Discord.

Where exactly did you pick up the idea to use node . ? Because I don't think that is the command you actually want to use. You are more likely to want to start your application. Thus, you need to provide the name of the file your application consists of. In your case that should be app.jsbot.js, or similar. At least something ending in .js.

 

What node . does, is just give the current directory you're in (. means "current directory" in the shell) to the node interpeter. It's not something Node can handle.

 

So just try to run your bot.js or app.js file directly using node bot.js (or node app.js).


- Mark
Copilot Lvl 3
Message 18 of 42

Re: I need help with bot making on Discord.

Sorry for the late response, was dealing with school and still am. In the video I watched (https://www.youtube.com/watch?v=X_qg0Ut9nU8)

Said to use the 'node .' 

Commander Lvl 3
Message 19 of 42

Re: I need help with bot making on Discord.

Hi @DemonWolfFang ,

 

I suspect that the person in the video uses node . because his main code file is called index.js. So you could either:

  • Also name your code file index.js instead of bot.js/app.js;
  • or run it using node bot.js node app.js

- Mark
Copilot Lvl 3
Message 20 of 42

Re: I need help with bot making on Discord.

The file was automatically named index.js and still is. I tried running 'node .' in CMD and the node.js app, but continue getting the same response 

node .
...