npm (Important)

Initialization

Before anything, after entering your directory for your bot, you need to initialize npm. To do this, run the following command in your terminal:

npm init -y

This will create a new file called package.json. Enter this file and do the following:

  1. Locate line 5, it should read as follows: "main": "index.js"

  2. The string that says index.js, you want to change this to be source/index.js

  3. The updated code should look like this: "main": "source/index.js"

  4. Save the file

Packages

The best thing to ever happen, npm packages. npm packages are basically plugins for Node.js. They allow you to create logging systems, Express Appsl, and make Discord Bots. For this entire guide, we will be using npm packages to assist us with development. These packages are discord.js, nodemon, mongoose, [email protected], canvacord@5, and commandkit

All of these, besides for nodemon, are required for our bot to function properly. To install all of these onto your Node.js project, run the following command:

npm i discord.js nodemon mongoose [email protected] canvacord@5 commandkit

Last updated