So I'm building a discord bot with javascript with node module. after I run with node. command it says MODULE NOT FOUND. how do I fix this? :/
import { Client } from 'discord.js';
const client = new Client();
const token = 'Token';
client.on('ready', () => {
console.log('This Bot is Online!');
})
client.login(token);
Please try these steps in order, without skipping any.
$ npm install discord.js
$ node ./index.js
$ less node_modules/discord.js/package.json | grep version
You will have to reinstall "discord.js" for every project or bot.
npm install discord.js
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.