Answer the question
In order to leave comments, you need to log in
It gives an error when starting the VK bot, what should I do?
Hello ... I'm starting to write my own bot for VK, I wrote the initial code
const express = require('express');
const bodyParser = require('body-parser');
const VkBot = require('node-vk-bot-api');
const app = express();
const bot = new VkBot({
token: 'секрет',
confirmation: 'секрет'
});
bot.on((ctx) => {
ctx.reply('Hello!');
});
app.use(bodyParser.json());
app.post('/', bot.webhookCallback);
app.listen(80);
PS C:\Users\Марк Ешкилев\Desktop\bot vk2> node bot.js
internal/modules/cjs/loader.js:969
throw err;
Error: Cannot find module 'express'
Require stack:
- C:\Users\Марк Ешкилев\Desktop\bot vk2\bot.js
←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:842:27)←[39m
←[90m at Module.require (internal/modules/cjs/loader.js:1026:19)←[39m
←[90m at require (internal/modules/cjs/helpers.js:72:18)←[39m
at Object.<anonymous> (C:\Users\Марк Ешкилев\Desktop\bot vk2\bot.js:1:17)
←[90m at Module._compile (internal/modules/cjs/loader.js:1138:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:986:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:879:14)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: [ ←[32m'C:\\Users\\Марк Ешкилев\\Desktop\\bot vk2\\bot.js'←[39m ]
}
Answer the question
In order to leave comments, you need to log in
Error: Cannot find module 'express'Can't find module 'express'.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question