Hot answers tagged

65

If you have CentOS 6.x, and have enabled the EPEL repository, you can use yum to install node/npm: $ sudo yum install npm After the installation is complete, check to make sure node is setup properly: $ node -v (Should return something like v0.10.36). If you want later versions of Node.js (e.g. 4.x, 5.x, etc.), you can use the Nodesource yum repository ...


47

For me the directory was in the correct context, only it was included in the (hidden) .dockerignore file in the root of the project. This leads to the error message: lstat mydir/myfile.ext: no such file or directory


45

You would need to use a reverse proxy to do this, e.g. Apache 2.4. with mod_proxy_wstunnel. Use it as a frontend and then tunnel the connections to the appropriate backend.


41

From the documentation : The <src> path must be inside the context of the build; you cannot COPY ../something /something, because the first step of a docker build is to send the context directory (and subdirectories) to the docker daemon. When you use /srv/visitor you are using an absolute path outside of the build context even if it's actually the ...


40

Use Rewrite conditions to match for this special case: RewriteEngine On RewriteCond %{REQUEST_URI} ^/socket.io [NC] RewriteCond %{QUERY_STRING} transport=websocket [NC] RewriteRule /(.*) ws://localhost:8082/$1 [P,L] ProxyPass /socket.io http://localhost:8082/socket.io ProxyPassReverse /socket.io http://localhost:8082/socket....


28

Jenkins kills all process spawn by the job. This can be disabled by setting the BUILD_ID environment variable to something else: export BUILD_ID=dontKillMe see https://wiki.jenkins-ci.org/display/JENKINS/ProcessTreeKiller for details


27

From my understanding, it seems that you only use one local dev machine, means not connected to any network that provides a DNS. If i am right, i would suggest to setup things like described below : step 1 : Assign at least two IP address to your MAC OS (one per domain), let's say : 192.168.0.10 192.168.0.11 To setup the second IP you will have to add a ...


25

You express configured to serve path /index.html, but you requires /test-express/index.html. Either configure express to serve /test-express/index.html or make nginx to strip /test-exress from proxied request. Latter is as simple as add trailing slashes to location and proxy_pass. location /test-express/ { proxy_pass http://127.0.0.1:3002/; } See http:...


22

The nodejs package you installed from the PPA includes npm since v0.10.0. Since you have v0.10.15, when you ran sudo apt-get install nodejs you also installed npm. Try to run npm to confirm. Also see the offical installation guide (the one you followed is a copy of it, but the official one has a few extra details).


22

Only a single process can listen on a particular port for the same IP address and protocol, because otherwise operating system wouldn't know which process to send the received packet to. To achieve what you want you will have to use a reverse proxy which will listen on port 80 and forward traffic to correct destination. There are multiple ways to do this. ...


22

By default SELinux only allows the web server to make outbound connections to a limited set of ports. # semanage port --list http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000 To fix the problem, you simply need to add your own desired port number to the list. # semanage port --add --type http_port_t --proto tcp 7777 Then ...


22

There are a lot of things you could be doing to improve your deployment process. A few of them are: Ensure your code is well tested. Ideally you should have 100% unit test coverage, as well as integration testing for every conceivable scenario. If you haven't got this, you should probably drop everything and get this taken care of. Look into behavior-...


20

Nginx connects to nodjs on the IPv6 loopback [::1]. nodejs is probably just listening on IPv4. Try setting upstream api { server 127.0.0.1:5000; } ...


15

You use the container's name as you defined it in docker-compose.yml. Docker provides the IP addresses for the named containers via DNS within each container, and updates them if the containers are updated. In this case, you called it server, so that is what you would use. proxy_pass http://server:8000; Documentation: Networking in Compose


14

Lets assume, Node.js running on http://localhost:8000 <VirtualHost node.example.com:80> ServerName node.example.com # with optional timeout settings ProxyPass / http://localhost:8000/ connectiontimeout=5 timeout=30 </VirtualHost> I hope that helps


13

Essentially, what it's doing is providing information to the server that it's proxying to. In order: X-Real-IP - the server you're proxying to is going to see the nginx proxy system as the "client IP" in any sort of application logic or logging that it's doing, since the nginx service is the source of the TCP connection. This is usually pretty worthless, ...


13

I just re-checked this. Both nodejs and npm and all dependencies for both have been added to epel 7. I just installed both on my CentOS 7 box. You should be able to do: yum -y install nodejs npm The -y flag will automatically answer "yes" to every confirmation question, so leave it out if you want to be able to say no to something.


13

Try adding this to your nginx.conf in the http {}: user www-data; worker_processes auto; pid /run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { # this section is needed to proxy web-socket connections map $http_upgrade $connection_upgrade { ...


12

Try from another terminal killall node Works in OS X and Linux. It may also prevent respawning node processes. For instance if a node some_server.js is running it may that any normal kill command (even kill -9 <PID_of_that_process> will simply result in a respawn node some_server.js process with a different PID. In that situation the only way to kill ...


12

in order to avoid this error, you can resolve the non-symlink executable with which node, as full example: sudo apt-get install libcap2-bin sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\`` the "which" command shows the full path of shell commands.


11

After few days of intense trial and errors, I'm glad to be able to say that I've understood where the bottleneck was, and I'll post it here so that other people can benefit from my findings. The problem lies in the pub/sub connections that I was using with socket.io, and in particular in the RedisStore used by socket.io to handle inter-process ...


10

As noted above, "tchol.org" is gone, leaving CentOS folks looking at either abandoning use of a package manager, or switching to another OS. I made a pact with myself against every doing the former (again) on all but experimental / dev boxes. Fortunately, there are rpms still available at: http://patches.fedorapeople.org/oldnode/stable/el6/x86_64/ Just ...


10

I've just come across this problem too. I found that a postinstall script would not run but a prestart would. Mine looks like this: "scripts": { "start": "node index.js", "prestart": "node node_modules/webpack/bin/webpack.js" } That now correctly bundles my webpack stuff before starting the server when I run eb deploy locally.


9

I know this question is super old, but I just ran into the same issue. Make sure the user you are running nginx as has write privileges to the proxy_temp directory. If you are serving a larger response through your proxy server that can't all be held in your proxy_buffers, the rest of the response data gets written to disk in your proxy_temp directory. If it ...


9

On Centos 7, for installation of npm and nodejs, follow these steps 1. Open terminal 2. Run these commands (With sudo or root) yum install epel-release yum install npm nodejs


9

It's stored in the Windows certificate store. When you import the signed certificate, you will find you have a corresponding private key. It matches them by modulus, if I recall. You can get a list of the private keys you have as a result of certificate enrollment requests (such as you made with certreq) by running certmgr.msc for the computer account (or ...


9

They added the file.exists() method. const fileExists = _=>{ return file.exists().then((data)=>{ console.log(data[0]); }); } fileExists(); //logs a boolean to the console; //true if the file exists; //false if the file doesn't exist.


8

The problem is (likely) not Chef running the command as the wrong user, but that the shell running your script is not a login shell. This means that some environment variables (like HOME) will not be set the way you expect, leading npm to try to write files in the wrong place. The problem is discussed in issue CHEF-2288. While that remains outstanding, ...


8

This worked for me on CentOS 5.7: yum install openssl-devel yum install python27 yum install gcc-c++ cd /usr/local/src wget http://nodejs.org/dist/node-latest.tar.gz tar zxvf node-latest.tar.gz cd node-v[tab] python2.7 configure make PYTHON=python2.7 make install


8

There's no point to using extremely restrictive rules on the loopback interface. All this will do is to prevent your local services from talking to each other in strange ways that you will have trouble diagnosing (which is why you're here). Just give up on it: iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT


Only top voted, non community-wiki answers of a minimum length are eligible