- FAQ
- Getting Started
- What is WWebJS?
- Disclaimer
- Requirements
- Guide
- Library
Introduction
Setup
Contributing
Prerequisites
Make sure you have Node.js version 16.0 or higher installed on your system.
Verify your installation:
node --version
npm --versionCreate a New Project
If you don't have an existing Node.js project, create one:
mkdir my-whatsapp-bot
cd my-whatsapp-bot
npm init -yInstall WWebJS
Install the latest version of whatsapp-web.js from npm:
npm install whatsapp-web.jsYou may also need to install Puppeteer separately:
npm install puppeteerOptional: Development Dependencies
For development, consider installing these useful tools:
npm install --save-dev nodemon
npm install --save-dev eslint
npm install --save-dev prettier- nodemon: Automatically restart your bot when files change
- eslint: Find and fix code issues
- prettier: Format code consistently
Verify Installation
Create a simple test file to verify everything works:
cat > test.js << 'EOF'
const { Client } = require('whatsapp-web.js');
console.log('WWebJS installed successfully!');
EOF
node test.jsYou should see the success message without errors.
Update your package.json
Edit your package.json to add a start script:
{
"scripts": {
"start": "node index.js",
"dev": "nodemon index.js"
}
}Next Steps
Now that WWebJS is installed, you can:
- Learn about Application Setup to configure your first bot
- Explore the Project Structure for organizing your code
- Check out the core concepts in the documentation
Troubleshooting
Having issues? Common problems and solutions:
- Puppeteer installation fails: Make sure you have 512MB+ disk space
- Module not found: Run
npm installagain in your project directory - Permission errors: Try running with
sudoor check your Node.js installation
Still stuck? Ask in the Discord community