UnhandledPromiseRejectionWarning: RequestError: Error: Invalid URI "0" - javascript

I am new to nodejs and trying to write this web scraper where I am getting the following errors. It asks to return promise however I tried but nothing works out. Not sure if I am using the right packages. Promises in async is quite difficult to understand for me at this point. Any explanation along with the code will be really apprciated.
PS C:\Users\farid\Desktop\Node Projects\webscraping> node --trace-warnings .\index.js (node:10748) UnhandledPromiseRejectionWarning: RequestError: Error: Invalid URI "0"
at new RequestError (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request-promise-core\lib\errors.js:14:15)
at Request.plumbing.callback (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request-promise-core\lib\plumbing.js:87:29)
at Request.RP$callback [as _callback] (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request-promise-core\lib\plumbing.js:46:31)
at self.callback (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request\request.js:185:22)
at Request.emit (events.js:315:20)
at Request.init (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request\request.js:273:17)
at Request.RP$initInterceptor [as init] (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request-promise-core\configure\request2.js:45:29)
at new Request (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request\request.js:127:8)
at request (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request\index.js:53:10)
at C:\Users\farid\Desktop\Node Projects\webscraping\index.js:13:26
at Object.<anonymous> (C:\Users\farid\Desktop\Node Projects\webscraping\index.js:50:3)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
at emitUnhandledRejectionWarning (internal/process/promises.js:168:15)
at processPromiseRejections (internal/process/promises.js:247:11)
at processTicksAndRejections (internal/process/task_queues.js:94:32)
(node:10748) RequestError: Error: Invalid URI "0"
at new RequestError (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request-promise-core\lib\errors.js:14:15)
at Request.plumbing.callback (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request-promise-core\lib\plumbing.js:87:29)
at Request.RP$callback [as _callback] (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request-promise-core\lib\plumbing.js:46:31)
at self.callback (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request\request.js:185:22)
at Request.emit (events.js:315:20)
at Request.init (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request\request.js:273:17)
at Request.RP$initInterceptor [as init] (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request-promise-core\configure\request2.js:45:29)
at new Request (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request\request.js:127:8)
at request (C:\Users\farid\Desktop\Node Projects\webscraping\node_modules\request\index.js:53:10)
at C:\Users\farid\Desktop\Node Projects\webscraping\index.js:13:26
at Object.<anonymous> (C:\Users\farid\Desktop\Node Projects\webscraping\index.js:50:3)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
(node:10748) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
at emitDeprecationWarning (internal/process/promises.js:180:11)
at processPromiseRejections (internal/process/promises.js:249:13)
at processTicksAndRejections (internal/process/task_queues.js:94:32)
PS C:\Users\farid\Desktop\Node Projects\webscraping>
Here is my index.js file code.
const request = require("request-promise");
const cheeri = require("cheerio");
const fs = require("fs")
const json2csv = require("json2csv").Parser;
const web_urls = ["https://www.gillmanacura.com/" , "https://www.gillmanacura.com/service/contact-service/"];
// const web_urls = ["https://www.fernandezhonda.com/trade-in-calculator/"];
(async() => {
let emptyData = [];
for(let web_url in web_urls){
let resp = await request({
uri: web_url,
headers:{},
timeout:10000,
json: true,
gzip: true
});
let $ = cheeri.load(resp)
let title = $('head title').text()
let desc = $('meta[name="description"]').attr('content')
let canonical = $('link[rel="canonical"]').attr('href')
let kwd = $('meta[name="keywords"]').attr('content')
let ogTitle = $('meta[property="og:title"]').attr('content')
let ogImage = $('meta[property="og:image"]').attr('content')
let ogkeywords = $('meta[property="og:keywords"]').attr('content')
emptyData.push({
title,
desc,
canonical,
kwd,
ogTitle,
ogImage,
ogkeywords
});
}
const j2csv = new json2csv()
const csv = j2csv.parse(emptyData)
fs.writeFileSync("./results.csv", csv, "utf-8");
})();
How can I resolve these errors? Please advise.

Use for of instead of in. in will iterate over the keys and of over the values.
for(let web_url in web_urls){

Related

Not able to solve "ReferenceError: Client is not defined" error

I am getting this error which I do not understand and am not able to fix.
The code is,
const fs = require('fs')
const Web3 = require('web3')
const { NonceTxMiddleware, SignedTxMiddleware, LocalAddress, CryptoUtils, HDWalletProvider } = require('#truffle/hdwallet-provider')
const client = new Client (
goerliChainId,
"https://eth-goerli.g.alchemy.com/v2/zEsvEP-zdgrdgdffgfgf64kuugnfvd6P",
"https://eth-goerli.g.alchemy.com/v2/oqB3MrwE1sdfgsdfgsdfgy5WD71Qj24n"
)
The error message is,
const client = new Client (
^
ReferenceError: Client is not defined
at Object.loadAccount (C:\Users\VidhanMangla\Desktop\mqube-blockchain-oracle\utils\common.js:13:20)
at init (C:\Users\VidhanMangla\Desktop\mqube-blockchain-oracle\Oracle.js:128:53)
at C:\Users\VidhanMangla\Desktop\mqube-blockchain-oracle\Oracle.js:138:60
at Object.<anonymous> (C:\Users\VidhanMangla\Desktop\mqube-blockchain-oracle\Oracle.js:149:3)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
at Module.load (node:internal/modules/cjs/loader:1081:32)
at Module._load (node:internal/modules/cjs/loader:922:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
I am not able to understand anything, please help.

TypeError: Cannot read properties of undefined (reading 'eth')

const {web3js, myAccount} = require ('./utils')
const {bytecode} = require ('./contractartifact')
async function deploy() {
web3js.eth.sendTransaction({
from: myAccount.address,
data: bytecode,
gas: 800
})
.on('receipt', console.log)
}
deploy()
Error
C:\Users\giris\getter-setter\deploy.js:9
web3js.eth.sendTransaction({
^
TypeError: Cannot read properties of undefined (reading 'eth')
at deploy (C:\Users\giris\getter-setter\deploy.js:9:12)
at Object. (C:\Users\giris\getter-setter\deploy.js:19:1)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules /cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
Your import is incorrect here:
const {web3js, myAccount} = require ('./utils')
It should be:
const web3js = new Web3(Web3.givenProvider || "ws://localhost:8545");

I'm getting an error but I can't resolve this error

MyCode;
eventHandler.js
const reqEvent = async(event) => require(`../events/${event}`);
module.exports = async(client) => {
client.on("ready", () => reqEvent("ready")(client, "message"));
client.on("message", () => reqEvent("message"));
}
y client definition
const client = new Discord.Client({
intents: [
Discord.Intents.FLAGS.GUILDS,
Discord.Intents.FLAGS.GUILD_MEMBERS,
Discord.Intents.FLAGS.GUILD_MESSAGES,
Discord.Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Discord.Intents.FLAGS.GUILD_VOICE_STATES
]
});
Error;
TypeError [ERR_INVALID_ARG_TYPE]: The "listener" argument must be of type function. Received an instance of Promise
at checkListener (node:events:128:3)
at _addListener (node:events:423:3)
at Client.addListener (node:events:487:10)
at module.exports (/app/util/eventHandler.js:5:12)
at Object.<anonymous> (/app/index.js:15:34)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'ERR_INVALID_ARG_TYPE'
}
I can't solve this error, can anyone help with the solution?
I Used Google Translate. I'm Sorry If I Have Any Mistakes.
try this
module.exports = async(client) => {
client.on("message", (message)=> {
reqEvent(message.content);
});
};

How to Read a .log File in JS?

How can I read this log.log file?
It currently console.log's:
{"type":"Buffer","data":[65,116,116,101,109,112,116,101,100,32,116,111,32,100,105,118,105,100,101,32,98,121,32,122,101,114,111,46,10]}
const displayLogFile = () => {
fs.readFile("./log.log", (err, file) => { //adding "utf-8" only logs a small portion of the .log file, but I was told this might be an async issue.
console.log(file);
});
};
log.log (local file):
Attempted to divide by zero.
Error: ENOENT: no such file or directory, open './NoFileNamedThis.txt'
at Object.openSync (fs.js:498:3)
at Object.readFileSync (fs.js:394:35)
at fileDoesNotExist (C:\Users.js:33:6)
at Object.<anonymous> (C:\Users:54:3)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47 {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: './NoFileNamedThis.txt'
}
Index was outside the bounds of the array.
TypeError: Cannot read property '0' of null
at arrayIsNull (C:\Users:44:6)
at Object.<anonymous> (C:\Users:66:3)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47
I would like to console.log() this .log, log file, but it console.log()'s an array buffer.
You're not specifying an encoding, so the file gets read as a Buffer.
If no encoding is specified, then the raw buffer is returned.
If options is a string, then it specifies the encoding:
readFile('/etc/passwd', 'utf8', callback);
const displayLogFile = () => {
fs.readFile("./log.log", "utf8", (err, file) => {
console.log(file);
});
};
to have it decoded into a string (assuming it's encoded in UTF-8).

DeprecationWarning, MongoNetworkError

Here is my database connection code
'use strict';
const config = require('../config');
const Mongoose = require('mongoose').connect(config.dbURI);
const mongoose = require('mongoose');
var options = {
promiseLibrary: require('bluebird'), useNewUrlParser: true, useUnifiedTopology: true
};
var mongodbUri = 'mongodb+srv://chatcat:chatcat#mychatcatdb-xlous.mongodb.net/test?retryWrites=true&w=majority'
mongoose.connect(mongodbUri, options);
var conn = mongoose.connection;
conn.on('error', console.error.bind(console, 'connection error:'));
module.exports = {
Mongoose
}
I'm getting this type of warning. i have also installed all of the packages which is required.
warning is just be like (node:17592) DeprecationWarning, (node:17592) UnhandledPromiseRejectionWarning.
what is the reason behind the this type of Warning ?
i just started learning node js.
please anyone help me to solve this warning?
D:\Node\ChatCAT\ChatCAT_Begin>node server
(node:17592) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
chatCat Running on Port: 3000
(node:17592) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
connection error: MongoNetworkError: failed to connect to server [mychatcatdb-shard-00-02-xlous.mongodb.net:27017] on first connect [MongoNetworkError: connection 5 to mychatcatdb-shard-00-02-xlous.mongodb.net:27017 closed
at TLSSocket.<anonymous> (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwonnection.js:372:9)
at Object.onceWrapper (events.js:418:26)
at TLSSocket.emit (events.js:311:20)
at net.js:668:12
at TCP.done (_tls_wrap.js:556:7) {
name: 'MongoNetworkError',
[Symbol(mongoErrorContextSymbol)]: {}
}]
at Pool.<anonymous> (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwerver.js:438:11)
at Pool.emit (events.js:311:20)
at D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwool.js:561:14
at D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwool.js:1008:9
at callback (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwonnect.js:97:5)
at D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwonnect.js:124:7
at _callback (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwonnect.js:349:5)
at Connection.errorHandler (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwonnect.js:365:5) at Object.onceWrapper (events.js:418:26)
at Connection.emit (events.js:311:20)
at TLSSocket.<anonymous> (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwonnection.js:370:12)
at Object.onceWrapper (events.js:418:26)
at TLSSocket.emit (events.js:311:20)
at net.js:668:12
at TCP.done (_tls_wrap.js:556:7) {
name: 'MongoNetworkError',
[Symbol(mongoErrorContextSymbol)]: {}
}
(node:17592) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [mychatcatdb-shard-00-02-xlous.mongodb.net:27017] on first connect [MongoNetworkError: connection 5 to mychatcatdb-shard-00-02-xlous.mongodb.net:27017 closed
at TLSSocket.<anonymous> (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwonnection.js:372:9)
at Object.onceWrapper (events.js:418:26)
at TLSSocket.emit (events.js:311:20)
at net.js:668:12
at TCP.done (_tls_wrap.js:556:7) {
name: 'MongoNetworkError',
[Symbol(mongoErrorContextSymbol)]: {}
}]
at Pool.<anonymous> (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwerver.js:438:11)
at Pool.emit (events.js:311:20)
at D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwool.js:561:14
at D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwool.js:1008:9
at callback (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwonnect.js:97:5)
at D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwonnect.js:124:7
at _callback (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwonnect.js:349:5)
at Connection.errorHandler (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwonnect.js:365:5) at Object.onceWrapper (events.js:418:26)
at Connection.emit (events.js:311:20)
at TLSSocket.<anonymous> (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwonnection.js:370:12)
at Object.onceWrapper (events.js:418:26)
at TLSSocket.emit (events.js:311:20)
at net.js:668:12
at TCP.done (_tls_wrap.js:556:7)
(node:17592) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:17592) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
connection error: MongooseError [MongooseServerSelectionError]: connection <monitor> to 3.7.80.251:27017 closed
at new MongooseServerSelectionError (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwction.js:22:11)
at NativeConnection.Connection.openUri (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGioose\lib\connection.js:823:32)
at Mongoose.connect (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGioose\lib\index.js:333:15)
at Object.<anonymous> (D:\Node\ChatCAT\ChatCAT_Begin\app\db\index.js:33:10)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGi.js:5:12)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (D:\Node\ChatCAT\ChatCAT_Begin\app\index.js:11:11)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14) {
message: 'connection <monitor> to 3.7.80.251:27017 closed',
name: 'MongooseServerSelectionError',
reason: TopologyDescription {
type: 'ReplicaSetNoPrimary',
setName: null,
maxSetVersion: null,
maxElectionId: null,
servers: Map {
'mychatcatdb-shard-00-00-xlous.mongodb.net:27017' => [ServerDescription],
'mychatcatdb-shard-00-01-xlous.mongodb.net:27017' => [ServerDescription],
'mychatcatdb-shard-00-02-xlous.mongodb.net:27017' => [ServerDescription]
},
stale: false,
compatible: true,
compatibilityError: null,
logicalSessionTimeoutMinutes: null,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
commonWireVersion: null
},
[Symbol(mongoErrorContextSymbol)]: {}
}
(node:17592) UnhandledPromiseRejectionWarning: MongooseServerSelectionError: connection <monitor> to 3.7.80.251:27017 closed
at new MongooseServerSelectionError (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGiDtbLrcW77HPEwrJM2Ej2yFNYwction.js:22:11)
at NativeConnection.Connection.openUri (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGioose\lib\connection.js:823:32)
at Mongoose.connect (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGioose\lib\index.js:333:15)
at Object.<anonymous> (D:\Node\ChatCAT\ChatCAT_Begin\app\db\index.js:33:10)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (D:\Node\ChatCGV9Jm2u7rmsCe65wKzPTw5jtS38n2tVEGi.js:5:12)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (D:\Node\ChatCAT\ChatCAT_Begin\app\index.js:11:11)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
(node:17592) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

Categories