node.js and npm has no network access in windows 7 64 bit ultimate - node.js

NOTE: to anyone else who has this problem, I tried all suggestions and all research. In the end I formatted the hard drive and reinstalled windows. Even though it was a fresh install from the start some windows installations just appear to not work at all with node. As far as I know this is the only solution.
So to start with, I already found the similar question:
Basic Node.js examples not working on Windows 7 which seems to be the same issue but there is no solution. I have also found forum posts online with no solutions but many people posting the same issues.
Node.exe and npm both appear to have no network access. npm install sends the get requests and never get a response. Node scripts that go to access a mongodb never send the connection request. I copied this code from my old machine to my new one. It was the first thing i put on the new machine. The old machine was running windows 7 64 home premium and the new one windows 7 64 ultimate. I've tried all compatibility modes, running as administrator, disabling windows firewall, there is no antivirus yet, i uninstalled/reinstalled, and I've tried changing the versions even though the version from old computer to new are the same. I've searched stackoverflow and the internet and have found others with the problem but no solutions. I have a virtual box ubuntu vm that can run node successfully however I would like to be able to run it without a vm if possible and I can't seem to find any cause of the problems. Even OEM software between the two computers are nearly identical since the old was an alienware m15x and the new is an m14x. Any help is appreciated.
edit:
I'm using the latest version currently (0.6.10). After running npm install and having it hang, i used netstat and got the following results under node.exe:
[node.exe]
TCP 10.20.21.225:49690 ec2-107-20-159-167.compute-1.amazonaws.com:https ESTABLISHED
[node.exe]
TCP 10.20.21.225:49691 nuq04s08-in-f31.1e100.net:https TIME_WAIT
TCP 10.20.21.225:49692 fa-in-f94.1e100.net:https TIME_WAIT
TCP 10.20.21.225:49693 nuq04s08-in-f19.1e100.net:http TIME_WAIT
TCP 10.20.21.225:49696 nuq04s08-in-f25.1e100.net:http TIME_WAIT
TCP 10.20.21.225:49702 nuq04s08-in-f6.1e100.net:http TIME_WAIT
TCP 10.20.21.225:49703 nuq04s08-in-f25.1e100.net:http TIME_WAIT
TCP 10.20.21.225:49704 nuq04s08-in-f25.1e100.net:http TIME_WAIT
TCP 10.20.21.225:49706 nuq04s08-in-f26.1e100.net:http TIME_WAIT
TCP 10.20.21.225:49707 nuq04s08-in-f26.1e100.net:http TIME_WAIT
TCP 10.20.21.225:49708 nuq04s08-in-f26.1e100.net:http TIME_WAIT
TCP 10.20.21.225:49709 nuq04s08-in-f26.1e100.net:http TIME_WAIT
Now when I run the example server on the node.js homepage, I cannot get the hello world in the browser however the connection is in netstat:
[node.exe]
TCP 127.0.0.1:1337 Robbie-PC:49805 ESTABLISHED
[node.exe]
TCP 127.0.0.1:7789 Robbie-PC:49158 ESTABLISHED
but when i wait a little while it changes to:
[node.exe]
TCP 127.0.0.1:1337 Robbie-PC:49805 CLOSE_WAIT
[node.exe]
TCP 127.0.0.1:7789 Robbie-PC:49158 ESTABLISHED
edit 2:
so I tried disabling all other connections.. no luck. Then I tried to use the debugger in eclipse, even eclipse couldn't find the vm's debugger broadcasting on port 5858. It literally just has no connection. So unless someone finally has any other ideas aside from wiping the hard drive and reinstalling windows, then I think this computer is going back to alienware as DOA. lets hope the next one doesn't have this problem. Thanks to all those who suggested things in the comments and to everyone who attempted to investigate a solution for me.

If you are behind a corporate network which probably needs proxy configuration on node to be setup. It runs something like this
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
Replace the proxy company name to whatever your network uses.

With the same OS I don't have this problem, but I already have problems downloading some packages (I wanted node mysql). In order to fix that I had to download the source from github, extract it in the node_modules repository and to rename it as "mysql".
Now I can make var mysql = require('mysql');

Maybe even try cygwin. Its a step back from both pure virtual Linux, and from getting it to run on Windows 7. Personally I have both Cygwin and Windows 7 installs of node.js on 64 bit (not ultimate though).
I just had to install node to a directory outside of 'program files' due to write protection and security settings. Still have to run the command console as administrator though to make sure all things work. Cygwin has none of these issues.

Related

django not accessible from another computer

followed instructions here to create my first django web sever. Haven't done any major customization yet, except.
Setup settings.py:
ALLOWED_HOSTS = ['192.168.1.111', 'localhost', '127.0.0.1']
Started django from cmd prompt
python manage.py runserver 0.0.0.0:8080
All the three url link works on this local machine where django is installed:
http://127.0.0.1:8080/, http://localhost:8080/, http://192.168.1.111:8080/
I then went onto Windows Firewall settings to include 8080 as an inbound rule:
My problem is http://192.168.1.111:8080/ does throw an exception when accessed from another computer (in the same network, IP being 192.168.1.77). Error is "Site cannot be reached, took too long to respond".
I am not able to figure out what am I doing wrong. I am certain its a firewall issue. Turned off windows firewall on 192.168.1.111 and it worked from 192.168.1.77. Question still remains - How do I make it work with firewall on on 192.168.1.111.
My python version is 3.9 and django version is 3.2. FYI - I moved to 8080 just for kicks. I had same issue with 8000.
Two things worth noticing:
(1) 192.168.1.111:8080 does throw a "Not secure connection" warning on the primary machine (where django is installed)
(2) netstat seems OK too:
C:\Windows\system32>netstat -ab
Active Connections
.
.
[postgres.exe]
TCP 0.0.0.0:7680 DEVSERVER:0 LISTENING
Can not obtain ownership information
TCP 0.0.0.0:8080 DEVSERVER:0 LISTENING
[python3.9.exe]
TCP 0.0.0.0:49664 DEVSERVER:0 LISTENING
.
.
Can not obtain ownership information
TCP 192.168.1.111:8080 DEVSERVER:50515 ESTABLISHED
[python3.9.exe]
TCP 192.168.1.111:49800 52.226.139.121:https ESTABLISHED
[SearchApp.exe]
TCP 192.168.1.111:50502 52.182.141.63:https TIME_WAIT
TCP 192.168.1.111:50515 DEVSERVER:8080 ESTABLISHED
.
.
C:\Windows\system32>
192.168.1.111:8080 just doesn't seem to work from any computer within the network. Tried from 192.168.1.77 (windows/chrome) and 192.168.1.75(windows/firefox)
OK.. so it was a firewall issue. Apparently, there was another outbound rule with python.exe that was override=True and blocking Public or Private UDP or TCP. I don't even remember. I just deleted all TCP rule relating to python and just kept one (noted in my question above). Its working now

psql - Mac trying to connect postgreSQL in Ubuntu system installed in a virtual machine in remote server

Apologize in front, maybe the situation here is a bit complicated. I searched everywhere online but couldn't find a perfect solution, plus I have tried almost all the solutions mentioned in other posts.
Situation:
So I have a postgreSQL database installed in a Ubuntu system. The system is actually a virtual machine on the VMware workstation 12, which is installed on Windows 7 professional. Now I am trying to remotely access the postgreSQL database through my MacBook pro 2013.
In the Mac terminal, the command line I tried is:
psql -U postgres -h xxx.xxx.xxx.xx
"xxx.xxx.xxx.xx" represents the IP address of the Windows 7 machine. The result is a failure:
psql: could not connect to server: Operation timed out
Is the server running on host "169.254.121.2" and accepting
TCP/IP connections on port 5432?
What I have done:
Edited the pg_hba.conf file to include
host all all 0.0.0.0/0 md5
Edited the postgresql.conf to include
listen_addresses='*'
Restarted postgres service.
Disabled firewall on the host.
I checked by running the psql command locally and it worked. Also, on the same VMware I have other Ubuntu systems. They are all fine to connect and access the data in this Ubuntu system.
Running Nmap, the output is
PORT STATE SERVICE
5432/TCP open postgresql
What's next? Anything else I can try? Any advice is highly appreciated and please let me know if anything above is ambiguous. I will clarify for better diagnosis. Thank you all!
Somehow managed to get it working..
So when I ran "Nmap" on the other Ubuntu system towards this one, it does shows
PORT STATE SERVICE
5432/TCP open postgresql
However, when I ran "Nmap" on my Mac, it's a different port, 3389, which is mainly used for Windows remote desktop. So what I did was to check the network configuration of this Ubuntu virtual machine from "bridged" to "NAT" and did a port forwarding to 5432. It is working fine now..
I read in some places saying that VMware favors bridged whereas VirtualBox favors NAT+port forwarding. I am quite confused as it is certain not the case in my situation. Maybe I am wrong.

How to secure memcached on Ubuntu 12.04

Running memcached on Ubuntu 12.04 LTS.
My /etc/memcached.conf file is set to only listen to localhost.
i.e. -l 127.0.0.1
But I can still telnet through to it from the outside even though it is set to only listen to localhost. My site really doesn't host any sensitive data whatsoever but I am a bit stumped that the config file doesn't really seem to do its job. I don't really see the need for IPtables. Any easy fix to secure memcached without having to set up IPtables?
Restart the service, you might have made change without restarting
To make more secure do not use the standard port

How to free stuck server ports?

I'm fairly sure that this is a bug in node v0.10.18, but it has created a pollution on my machine which I don't know how to clear.
I have this simple tcp server (coffee) script:
net = require 'net'
server = net.createServer ->
server.listen 'localhost:4545'
when I run it using coffee z.coffee and then press Ctrl+C to interrupt it, I am unable to run it again on the same port due to EADDRINUSE exception. The process repeats on different ports with the same results.
I am aware of other answers about a similar issue, but they aren't able to solve mine because even restarting the machine (osx ml) still leaves the port blocked. Obviously, ps -A | grep node shows nothing as well.
What can I do to free up the stuck ports again?
Edit
Here is an abstract of the comments below. It seems that node uses SO_REUSEADDR be default, so TIME_WAIT should not be the issue, especially since the ports have been stuck for over an hour. Neither netstat nor lsof as root show anything using the ports, and neither multiple reboots, nor killing all but essential programs helped the issue resolve. There is no VPN or firewall.
https://github.com/joyent/node/blob/3d4c663ee68326990e0732a4aa76445688e1064e/lib/net.js#L1159
You are passing invalid arguments to server.listen. It is interpreting your string as a unix domain socket filesystem path.
This program works fine and can be killed and restarted immediately.
net = require "net"
server = net.createServer ->
console.log "connection"
server.listen 1337, "127.0.0.1"
Pass correct arguments to server.listen and all is well.

IIS and Glassfish in Windows 7

I installed the newest version of Windows 7.
This is my development box, so I have glassfish installed, which I use for Java applications. Also, I use IIS to run PHP applications. I run both servers on port 80, but never at the same time.
However, since I set up IIS, I can't get glassfish to run. In eclipse, it always gives the following error:
Port conflict: Please stop the server process using the same port as the one used by the Application Server.
A server process is already running on this port but we cannot determine if it's a GlassFish process (lack of info or credentials).If you do not find something else running on this port, check for antivirus software blocking or monitoring this port.
Edit: I tried turning off IIS, and even turned off the IIS feature. Still no luck.
I also ran netstat, and the following are showing up on ports that glassfish uses:
Proto Local Address Foreign Address State
TCP 0.0.0.0:80 NBSDTVL01574:0 LISTENING
TCP [::]:80 NBSDTVL01574:0 LISTENING
Thanks
This turned out to be an issue with my virtual machine. A fresh copy fixed the issue.
this happen because you select the same port number use by the iis and glashfish, i suggest you configure either of the two to use different port number.

Resources