Wednesday, 3 May 2017

node practicebot.js 'node' is not recognized as an internal or external command using

Okay, so I am trying to make a discord bot with the discord.js module in node.js. Here is my code from the js file, batch file, and what the batch file says:


JS FILE:

const Discord = require("discord.js"); const client = new Discord.Client();

client.login(TOP SECRET I ERASED THIS TO HIDE);

client.on("ready", () => {

console.log("I am ready to serve thy players!");

});

client.on("message", message => {

if (message.content("!greeting")) {

message.reply("Hello there, " + message.author.username); }

});


BATCH FILE:

node practicebot.js

PAUSE


What the batch file says upon double-clicking:

C:\Users\tr152344\Desktop\Practice Bot>node practicebot.js 'node' is not recognized as an internal or external command, operable program or batch file.

C:\Users\tr152344\Desktop\Practice Bot>PAUSE Press any key to continue . . .


I checked numerous topics and none of them have helped. I tried restarting my computer, reinstalling node.js, and on the installation, it adds everything necessary to the PATH so I am out of options so I came here. What I am thinking is that there might either be an error in my code, or something unknown.

THE PROGRAM I AM USING TO WRITE THE NODE.JS AND BATCH FILES IS CALLED ATOM



via Tyler R.

No comments:

Post a Comment