Installation
This guide will help you install Newt on your computer so you can start building Discord bots.
What You Need Before Installing
Node.js
What is it? Node.js is a program that runs JavaScript code outside of a web browser. Your Discord bot needs it to run.
How to get it:
- Go to nodejs.org
- Download the LTS (Long Term Support) version - it's the most stable
- Run the installer and follow the prompts
Why version 20 or higher? Newt uses modern JavaScript features that require newer versions of Node.js.
npm
What is it? npm (Node Package Manager) comes with Node.js. It's a tool that helps you download and manage software packages like Newt.
How to check if you have it:
npm --versionIf you see a version number, you're good to go!
A Text Editor
You'll need a program to write your Newt code. We recommend:
- VS Code - Free, popular, and has great Newt support
- Download from code.visualstudio.com
Installing Newt
Option 1: Global Installation (Recommended)
This installs Newt on your entire computer so you can use it from anywhere.
Run this command:
npm install -g @newt-dev/cliWhat this does:
- Downloads the Newt tool
- Makes the
newtcommand available in your terminal - Lets you use Newt from any folder on your computer
Verify it worked:
newt --versionYou should see version information like @newt-dev/cli 0.1.0.
Option 2: Local Installation
Install Newt only in a specific project folder:
npm install @newt-dev/cliThen use it with npx:
npx newt check my-bot.newtWhen to use this: If you only want to use Newt in one project or don't have permission to install globally.
Troubleshooting Installation
"Permission denied" (Linux/Mac)
If you get a permission error, try:
sudo npm install -g @newt-dev/cli"Command not found" (Windows)
If newt command doesn't work:
- Restart your terminal - Sometimes it needs a restart to recognize new commands
- Check your PATH - Make sure npm's global bin folder is in your system PATH
- Find where npm installs packages:bashThis shows where packages are installed. Add this folder to your PATH.
npm config get prefix
"npm is not recognized"
This means Node.js isn't installed or isn't in your PATH:
- Make sure you installed Node.js
- Restart your computer after installing
- Try reinstalling Node.js
Setting Up Your Editor
VS Code (Recommended)
- Install VS Code
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Newt"
- Install the Newt Language Support extension
What this gives you:
- Syntax highlighting (colors in your code)
- Error detection (underlines mistakes)
- Auto-completion (suggests commands as you type)
Other Editors
Newt files use the .newt extension. You can:
- Use plain text editing
- Configure your editor for generic syntax highlighting
- Use any editor you're comfortable with
System Requirements
Operating Systems
- Windows - Windows 10 or later
- macOS - macOS 10.15 (Catalina) or later
- Linux - Any modern distribution (Ubuntu, Debian, Fedora, etc.)
Hardware
- RAM: 512MB minimum (most computers have way more)
- Disk Space: 100MB for Newt installation
- Network: Required for downloading Newt and connecting to Discord
What This Means
If your computer was made in the last 10 years, it probably meets these requirements. You don't need a powerful computer to run Discord bots.
Upgrading Newt
To get the latest version with new features and bug fixes:
npm update -g @newt-dev/cliWhat this does: Updates Newt to the newest version while keeping your settings.
Uninstalling Newt
If you want to remove Newt from your computer:
npm uninstall -g @newt-dev/cliNote: This won't delete any bots you've created - just the Newt tool itself.
Next Steps
Now that Newt is installed, you're ready to build your first bot!
- Quickstart Guide - Build your first Discord bot in 5 minutes
- Token Security - Learn how to keep your bot safe
- Language Reference - Explore all available commands