This question already has answers here:
Unable to run Protractor - ECONNREFUSED connect ECONNREFUSED
(12 answers)
Closed 6 years ago.
I am trying see the actual html content before being rendered by the browser. So I am using selenium-webdriver in node.js.
Here's my code and the error I'm getting:
Code
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().
usingServer('http://localhost:4444/wd/hub').
withCapabilities(webdriver.Capabilities.chrome()).
build();
driver.get('http://www.example.com/example/abc');
driver.getPageSource().then(function(html) {
console.log(html);
return true;
});
driver.quit();
Error
/home/abhishek/node_modules/selenium-webdriver/lib/webdriver/promise.js:1761
throw error;
^
Error: ECONNREFUSED connect ECONNREFUSED
at ClientRequest.<anonymous> (/home/abhishek/node_modules/selenium-webdriver/http/index.js:145:16)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1547:9)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:441:14
at process._tickCallback (node.js:415:13)
==== async task ====
WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (/home/abhishek/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:149:22)
at Function.webdriver.WebDriver.createSession (/home/abhishek/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:123:30)
at Builder.build (/home/abhishek/node_modules/selenium-webdriver/builder.js:294:22)
at Object.<anonymous> (/home/abhishek/crawler_postman/crawler_selenium.js:15:14)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
That means webserver is not running. Try running webdriver-manager start --standalone in a new command line window or tab
From: https://stackoverflow.com/a/21124867/577977
Related
So i was working on a login system with MySql. At first it worked perfectly, but after a bit of time it stopped working and now when I start it it gives me
Error: connect ETIMEDOUT
at Connection._handleConnectTimeout (I:\Websites\backend\node_modules\mysql\lib\Connection.js:409:13)
at Object.onceWrapper (events.js:519:28)
at Socket.emit (events.js:400:28)
at Socket._onTimeout (net.js:484:8)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7)
--------------------
at Protocol._enqueue (I:\Websites\backend\node_modules\mysql\lib\protocol\Protocol.js:144:48)
at Protocol.handshake (I:\Websites\backend\node_modules\mysql\lib\protocol\Protocol.js:51:23)
at Connection.connect (I:\Websites\backend\node_modules\mysql\lib\Connection.js:116:18)
at Object.<anonymous> (I:\Websites\backend\Main.js:20:4)
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 {
errorno: 'ETIMEDOUT',
code: 'ETIMEDOUT',
syscall: 'connect',
fatal: true
}
What is also important to say is that I do not host the Database on my PC, I have rented a server for it. Hope that someone can help
I am facing issue to run the JavaScript file in VS code.
I am getting the output as:-
[Running] node "e:\n\Temporay folders of web development\vs code project\tut64.js"
node:internal/fs/utils:343
throw err;
^
Error: ENOENT: no such file or directory, open 'tut64.txt'
at Object.openSync (node:fs:582:3)
at Object.readFileSync (node:fs:450:35)
at Object.<anonymous> (e:\n\Temporay folders of web development\vs code project\tut64.js:2:17)
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:79:12)
at node:internal/main/run_main_module:17:47 {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: 'tut64.txt'
}
[Done] exited with code=1 in 0.839 seconds
And in the terminal I am getting:-
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS E:\n\Temporay folders of web development\vs code project> node \tut64.js\
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'E:\tut64.js'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
I am not getting what type of these errors are and why I am getting them.
In the terminal you should do node tut64.js
And check the path of tut64.txt or post your code.
I tried a basic beginner program in Node.Js where I wanted to use the built-in module 'http'. After executing a basic program of http.createServer(). Below is my source code.
var http = require('http');
http.createServer(function (req, res) {
res.write('Hello World!');
res.end();
}).listen(8080);
When running the code in cmd it didn't run and displayed the following error.
events.js:287
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE: address already in use :::8080
at Server.setupListenHandle [as _listen2] (net.js:1313:16)
at listenInCluster (net.js:1361:12)
at Server.listen (net.js:1449:7)
at Object.<anonymous> (F:\NodeJS\first app\w3schools\moduleIntro,.js:7:4)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
Emitted 'error' event on Server instance at:
at emitErrorNT (net.js:1340:8)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'EADDRINUSE',
errno: 'EADDRINUSE',
syscall: 'listen',
address: '::',
port: 8080
}
Ok, it's not problem in your code actually 8080 already running anywhere else so you can't run the same port number at a time so just close all running process Or you just shut down your PC and run again the problem will be resolve.
I've seen a ton of conflicting answers and I want this thread to be very conclusive. I'm running a Node.js app that needs to have a server endpoint to call a google mysql database.
The SQL call I'm making in server.js should be fine, empty though. Regardless, the break point isn't at the SQL call.
There's no enforced password set up so I have those credentials set up as
...
user: 'root',
password: '',
...
and I'm currently not using the socketPort configuration option.
Respond if you need any more information about the database.
This is a full stack trace, you can see it yourself by running npm run dev
Error connecting: Error: connect ETIMEDOUTat Connection._handleConnectTimeout (C:\Users\********\Projects\security-project\security-dashboard\node_modules\mysql\lib\Connection.js:412:13)
at Object.onceWrapper (events.js:286:20)
at Socket.emit (events.js:198:13)
at Socket._onTimeout (net.js:442:8)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
--------------------
at Protocol._enqueue (C:\Users\********\Projects\security-project\security-dashboard\node_modules\mysql\lib\protocol\Protocol.js:144:48)
at Protocol.handshake (C:\Users\********\Projects\security-project\security-dashboard\node_modules\mysql\lib\protocol\Protocol.js:51:23)
at Connection.connect (C:\Users\*******\Projects\security-project\security-dashboard\node_modules\mysql\lib\Connection.js:119:18)
at Object.<anonymous> (C:\Users\*********\Projects\security-project\security-dashboard\database.js:26:12)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
[ ready ] compiled successfully
I'm trying to run node app server.js with the imported code from GitHub but getting below error in the console. Not sure why I'm getting this error.
Error :util.js:959 Object.setPrototypeOf(ctor.prototype, superCtor.prototype);
TypeError: Object.setPrototypeOf called on null or undefined
at Function.setPrototypeOf (native)
at Object.exports.inherits (util.js:959:10)
at Object.<anonymous> (businessvalidationexception.js:1:17)
at Module._compile (module.js:541:32)
at loader (/home/vagrant/Desktop/..../node_modules/babel-core/node_modules/babel-register/lib/node.js:126:5)
at Object.require.extensions.(anonymous function) [as .js] (/home/vagrant/Desktop/..../node_modules/babel-core/node_modules/babel-register/lib/node.js:136:7)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)