I just just started messing with node so pardon me if i sound noob.
I don't really use Node, so no idea, trying to install discord.io and isn't installing, it has in the past not sure what's wrong now.
Any ideas?
I just just started messing with node so pardon me if i sound noob.
But, if you're installing the package onto your whole pc you'll wanna use npm install -g <package> (-g means global), and if you're only installing it onto one of your projects you can use npm install --save <package> and it places it in node_modules folder of your current directory.
as for the warnings about the desc and license and readme, you can ignore those. it's just letting you know that you left some fields empty in your package.json
also, to launch some packages sometimes it's as easy as npm start discord.io, but idk in your case
var Discord = require('discord.io');
Yeah probably why. You should look for installing errors when downloading a module. And btw, you can just useThanks a lot! This helped a ton, it's installed now.
However, when trying to run the bot.js file it gives me an error which it says resides on Line 1 which is
Code:var Discord = require('discord.io');
I'm guessing this is suggesting it hasn't properly installed or installed at all?
Yeah probably why. You should look for installing errors when downloading a module. And btw, you can just useYou must be registered for see linksinstead of var and you don't have to use semicolons in that particular example because of ASI in ES5
Yeah, I've looked deeper and found out the modules aren't saving to the nodejs folder in the program files directory but elsewhere, this could possibly be the problem right? I deleted the folder in the wrong directory and ran npm install -g discord.io winston & it re-creates the folder in the wrong place, I've also moved the modules to the right directory but has no effect, any ideas?
I also touched up the code, thank you for the tip
Forgot to reply, thanks a lot for your help really appreciated.cd <directory where bot.js is>
npm init
<enter> xwhatever
"entry point": bot.js
*package.json generated*
npm install --save discord.io
node bot.js
it should then run, using the package saved to node_modules
Will bare this in mind, thank you.Also you might want to use nodemon, so you don't need to retype node bot.js all over again.