ng serve permission denied 127.0.0.1:4200 - node.js

When trying to ng serve a new angular project it return me an error
[error] Error: listen EACCES: permission denied 127.0.0.1:4200
at Server.setupListenHandle [as _listen2] (net.js:1260:19)
at listenInCluster (net.js:1325:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1458:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:62:10)
npm version : 6.4.1
angular cli version : 8.3.25
Node version : 10.15.2
What I've tryed
Restart multiple times my computer
I've tryed to find if the port was already in use with netstat -a -o -n but no
Change port and hostname to be sur : ng serve --host 0.0.0.0 --port 4401
Tryed : npm cache clean --force --unsafe-perm
I am starting a new project in angular 8. I've didn't touche my angular projects since last year and all my old projects don't starts anymore with ng serve. I've look on the net and this error appends a lot with docker. I've install last week Docker sandbox on my laptop and add some problems of compatibility with it. Could it be related ?

Related

How to fix Kotlin Reactjs tutorial error: listen EADDRINUSE

As part of this basic tutorial, I downloaded the code from this repo, and attempted to run it with the command ./gradlew run on an Ubuntu 20.04 environment.
This resulted in the following error:
> Task :browserDevelopmentRun
✖ 「wds」: Error: listen EADDRINUSE: address already in use 127.0.0.1:8080
✖ 「wds」: Error: listen EADDRINUSE: address already in use 127.0.0.1:8080
at Server.setupListenHandle [as _listen2] (net.js:1318:16)
at listenInCluster (net.js:1366:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1503:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:69:8) {
code: 'EADDRINUSE',
errno: -98,
syscall: 'listen',
address: '127.0.0.1',
port: 8080
}
The process seems to be the only one running on this port, and attempts to get rid of any other processes using port 8080 (sudo kill -9 'sudo lsof -t -i:8080', killall node, etc...) have no effect. The conflicting processes seem to both come from within the tutorial web app.
Changing the port using a .env file also did not work. No matter what port is set (8081, 3000, 83000, etc...), there is still the error of port 8080 already being in use.
Does anyone know a solution to this issue? Thanks!
So while I didn't figure out exactly which dependency was causing this issue, on trying out a couple of the pull request on the repository, I found that this one: https://github.com/kotlin-hands-on/web-app-react-kotlin-js-gradle/pull/11 fixes the problem. Hopefully, it will be merged into the main branch soon!

ONLYOFFICE Developer Edition demo issue - error downloadFile

I installed and run OnlyOffice docker image on my local windows machine with this command:
docker run -i -t -d -p 9950:80 --restart=always -v C:/work/only_office/logs:/var/log/onlyoffice onlyoffice/documentserver-de
Then run commands described on this page - http://localhost:9950/welcome/ for testing OnlyOffilce:
docker exec 2a9aa47c18a2 sudo supervisorctl start ds:example
docker exec 2a9aa47c18a2 sudo sed "s,autostart=false,autostart=true," -i /etc/supervisor/conf.d/ds-example.conf
This page - http://localhost:9950/example/ starts working. But when I try to create, open or upload document I am getting this error:
And errors in the log files:
[2020-07-07T12:30:24.892] [ERROR] nodeJS - error downloadFile:url=http://127.0.0.1:9950/example/files/172.17.0.1/new%20(2).docx;attempt=1;code:ECONNREFUSED;connect:null;(id=172.17.0.1http___127.0.0.1_9950_example_files_172.17.0.1_new_20_2_.docx1594125018845)
Error: connect ECONNREFUSED 127.0.0.1:9950
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
[2020-07-07T12:30:25.894] [ERROR] nodeJS - error downloadFile:url=http://127.0.0.1:9950/example/files/172.17.0.1/new%20(2).docx;attempt=2;code:ECONNREFUSED;connect:null;(id=172.17.0.1http___127.0.0.1_9950_example_files_172.17.0.1_new_20_2_.docx1594125018845)
Error: connect ECONNREFUSED 127.0.0.1:9950
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
[2020-07-07T12:30:26.897] [ERROR] nodeJS - error downloadFile:url=http://127.0.0.1:9950/example/files/172.17.0.1/new%20(2).docx;attempt=3;code:ECONNREFUSED;connect:null;(id=172.17.0.1http___127.0.0.1_9950_example_files_172.17.0.1_new_20_2_.docx1594125018845)
Error: connect ECONNREFUSED 127.0.0.1:9950
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
[2020-07-07T12:30:24.881] [ERROR] nodeJS - postData error: docId = 172.17.0.1http___127.0.0.1_9950_example_files_172.17.0.1_new_20_2_.docx1594125018845;url = http://127.0.0.1:9950/example/track?filename=new%20(2).docx&useraddress=172.17.0.1;data = {"key":"172.17.0.1http___127.0.0.1_9950_example_files_172.17.0.1_new_20_2_.docx1594125018845","status":1,"users":["uid-1"],"actions":[{"type":1,"userid":"uid-1"}]}
Error: connect ECONNREFUSED 127.0.0.1:9950
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
I tried to switch off firewall and test it on another Windows PC but the issue is the same. Any ideas how to fix it?
Check this one out. Seems like some process is running on the port you are using. Try switching your ports.
References:
"The ECONNREFUSED Connection refused by the server error, is a common error returned by the Filezilla FTP client. This error indicates that the user is trying to connect to your server and is unable to connect to the port."
https://community.progress.com/s/article/Connection-Error-ECONNREFUSED-Connection-refused-by-the-server
ECONNREFUSED on running localhost server from NodeJS
Node.js Error: connect ECONNREFUSED
I had the same problem and after trying for a while I just try following the documentation and it worked, you have to run the docker image in port 80, that will solve the error.
docker run -i -t -d -p 80:80 --restart=always -v C:/work/only_office/logs:/var/log/onlyoffice onlyoffice/documentserver-de
I'm searching for change the port in a proper way. Let me know if you find out.
According to support's answer the current last version (5.5.3) of OnlyOffice is not working on Windows docker:
Unfortunately, at the moment we do not recommend using this method of
installing Document Server. If you would like to use a docker
installation, please use this Document Server installation guide on
*NIX systems.
I run docker image on CentOs server. Now everything is working as expected.

What is sunproxyadmin service?

I was trying to run a front end project locally after pulling it down from git. After which I got the following error:
vents.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 127.0.0.1:8081
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at Server.setupListenHandle [as _listen2] (net.js:1351:14)
at listenInCluster (net.js:1392:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1501:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:97:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! apex-library#1.0.24 dev: `webpack-dev-server --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the apex-library#1.0.24 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I was like, "Hold up, i'm not running anything!!". or was I? After running
sudo lsof -i :8081
I saw:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
cma 265 root 16u IPv6 0x2756c3c2bce3e369 0t0 TCP *:sunproxyadmin (LISTEN)
I saw that webpack-dev-server was trying to start on the same port as sunproxyadmin
...
devServer: {
port: 8081,
hot: true,
},
...
Ok, so what is sunproxyadmin and who is cma (get off my lawn!!!)
(btw I know how to kill it)
PS: Some one with more stack overflow points who agrees please create tags for sunproxyadmin, EADDRINUSE and cma
After digging around I see that cma is an agent of Mcaffe which is using sunproxyadmin.
I figured I could just find out how to change the port it uses but then I don't have access to change the port that it uses on my machine because it is set by our IT department and the process itself is started by the root user:
The wakeup port is a global setting, so you can't just change it on
certain agents: it has to be all of them...
To change the port, simply change it in the Configuration / Server
Settings page, and the agents will pick up the new port the next time
they contact the server.
https://community.mcafee.com/t5/ePolicy-Orchestrator/Linux-CMA-Agent-port-chnage/td-p/314596
Most searches on this topic lead to issues with react for some reason which is probably why I found the solution for killing it here:
sudo lsof -n -i4TCP:8081 # get the process' PID
sudo launchctl list | grep 5693 # find the launchd endpoint
sudo launchctl remove com.mcafee.agent.macmn
So in the end killing it was my only recourse other than changing the port webpack dev server starts up with.

"ionic start project test" giving error ENOTFOUND github:443

I am trying to create an ionic application but getting below error
Command:-
ionic create testapp sidemenu
Error: getaddrinfo ENOTFOUND github.com github.com:443
"
Creating Ionic app in folder ~..\conference base
d on sidemenu project
Downloading: https://github.com/driftyco/ionic-app-base/archive/master.zip
Error Initializing app: Error: getaddrinfo ENOTFOUND github.com github.com:443
Error: getaddrinfo ENOTFOUND github.com github.com:443
at errnoException (dns.js:26:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
getaddrinfo ENOTFOUND github.com github.com:443 (CLI v1.7.8)
Your system information:
Cordova CLI: 5.4.0
Ionic CLI Version: 1.7.8
Ionic App Lib Version: 0.6.4
OS: Windows 7 SP1
Node Version: v4.2.1
"
Please suggest how to resolve this, I am new in phonegap/ionic/nodejs
[EDIT] proxy has already been configured successfully.
You have to update your ionic version. This command can't be launch with a CLI version under v1.7.10.
Have a look at the tutorial : https://creator.ionic.io/app/dashboard/help/videos
I am also getting that same Issue.
I also set proxy, http-proxy for npm already but still getting issue
I Fixed this by setting proxy in ionic module as explained in this link
Basically you just need to add below line at line no 421 (approx. just before tunnel creation in code) in require.js for setting proxy and then this Ionic CLI will start working.
// hack to add proxy
self.proxy = 'http://proxy-ip:proxy-port';

Cloud9 + sails.js + phpmyadmin

I have problem with creating basic sails.js application on Cloud9 environment and connecting it to MySQL.
Steps I'm making:
Creating Cloud9 project
installing sails: npm -g install sails
creating project: sails new test
lifting: cd testProject/ and sails lift
Here it's working
Adding mySQL support: mysql-ctl start
still working
adding phpMyAdmin support: phpmyadmin-ctl install
And here, my application stops working. I'm getting exception:
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:905:11)
at Server._listen2 (net.js:1043:14)
at listen (net.js:1065:10)
at Server.listen (net.js:1139:5)
at Array.async.auto.start [as 0] (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/lib/hooks/http/start.js:29:35)
at /home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/async/lib/async.js:484:38
at _each (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/async/lib/async.js:46:13)
at Object.async.auto (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/async/lib/async.js:455:9)
at Sails.startServer (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/lib/hooks/http/start.js:16:11)
at Sails.emit (events.js:92:17)
at Sails.emitter.emit (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/lib/app/private/after.js:50:11)
at afterBootstrap (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/lib/app/private/initialize.js:56:11)
at bootstrapDone (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/lib/app/private/bootstrap.js:51:14)
at Object.module.exports.bootstrap (/home/ubuntu/workspace/testProject/config/bootstrap.js:16:3)
at Sails.runBootstrap (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/lib/app/private/bootstrap.js:44:25)
at Sails.bound [as runBootstrap] (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21)
at Sails.initialize (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/lib/app/private/initialize.js:48:9)
at bound (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21)
at /home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/async/lib/async.js:607:21
at /home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/async/lib/async.js:246:17
at iterate (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/async/lib/async.js:146:13)
at /home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/async/lib/async.js:157:25
at /home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/async/lib/async.js:248:21
at /home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/async/lib/async.js:612:34
at /home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/lib/app/load.js:201:13
at /home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/async/lib/async.js:451:17
at /home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/async/lib/async.js:441:17
at _each (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/async/lib/async.js:46:13)
at Object.taskComplete (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/sails/node_modules/async/lib/async.js:440:13)
at processImmediate [as _immediateCallback] (timers.js:354:15)
Additionally I'm getting info about problem with starting my app, and ability to kill the process. Of course killing does not help.
Could youplease help me with that?
So what's happening is that you're starting your sails server, which binds to port 8080, and then you try to install phpmyadmin which tries to start apache (at port 8080 too!) causing it to actually fail since the port is already in use. You will have to stop sails before trying to install / run phpmyadmin since two servers can't listen on the same port.

Resources