πŸ“„Create the package.json

The package.json file is a kind of manifest for your project. It can do a lot of things, it is also where npm stores the names and versions of all the installed packages that your project depends on.

How do I create the package.json file?

Open the Terminal in your project's directory (Windows use: Shift+Right Button and click Open PowerShell) and type:

npm init -y

You need NodeJS and npm installed on your computer, if it is not installed follow the instructions below.

Putting dependencies in your package.json

Installing discord.js

To install, type in your Terminal

npm install discord.js

Your package.json should look like this.

package.json
{
  "name": "discloudbot",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "discord.js": "^14.0.3"
  }
}

Last updated