Can I run Node.js on cPanel without CloudLinux? - node.js

I'm trying to deploy a node.js app on my server.
I've followed the instructions laid out by cPanel in their documentation here: Guide to Node.js Installations and here: How to Install a Node.js Application. I want to do this without CloudLinux and given Apache's Node.js module it seemed to be possible.
However, even though deploying the app in the backend seems fine, I'm getting this error when trying to access the app in my browser:
The Phusion Passenger application server tried to start the web application through a Passenger-internal helper tool called the SpawnEnvSetupper. But that helper tool encountered an internal error.
Error Details: Failed to initialize LVE library: : init_lve error [2]
The stdout/stderr output of the subprocess so far is: Error: Failed to initialize LVE library: : init_lve error [2]
I don't know much about LVE but I do know that it's a part of CloudLinux. So, do I still need to have CloudLinux installed after all? Thanks.
Update:
Tried deploying the same node.js app on a subdomain and had the same error. Then I tried to deploy it on another server that I manage (following the same steps) and was able to do so successfully. My hosting company seems to think there was an issue when I uninstalled CloudLinux from my server. (I had previously set it up to run Node and then had it removed once I discovered that I wouldn't need it.)

To answer my own question ...
Yes, Node.js can run on cPanel without CloudLinux.
By following the instructions in the cPanel documentation here (Guide to Node.js Installations) and here (How to Install a Node.js Application), a Node.js app can be deployed successfully.
In my particular situation above, I had installed CloudLinux on my server originally to deploy Node.js apps before cPanel came out with their own module for Apache. Given that I was paying extra for the CloudLinux software, I wanted to remove it from my hosting account and leverage the Apache module. During the uninstall, it turns out that LVE and other libraries related to CloudLinux were not removed correctly causing the error (not sure why yet). By simply removing those and restarting my server the Node app started functioning properly again.

Related

How do you install Next.js on shared host with cPanel/SSH?

I have installed a Node.js app using cPanel, and that seems to work fine - but how do you install for example Next.js, when npm/npx doesn't work in SSH?
Usually I would just run npx create-next-app, at least locally this works fine.
Am I wrong to use a shared host with LiteSpeed/cPanel? I see the Next.js documentation strongly recommends using their own Vercel platform, but I would rather use whatever I'm used to - assuming that is possible.
Any help is much appreciated.

Cannot deploy node.js app on GAE

I'm having trouble deploying my node.js app to GAE.
It's a simple app that connects to my Firebase and updates a value. Just to get started.
Whenever I try to deploy the app it fails. Runs fine locally.
I deleted my project and started a fresh one, and deployed the default 'hello-world' app after downloading the zip and it worked fine.
I installed firebase on the project via the cloud shell.
Added
var Firebase = require("firebase");
to the app.js file and it no longer deploys.
I am new to GAE and cannot understand why it won't deploy. I feel like if i'm having trouble just including firebase in an app, I'm in for a tough time.
This is the error I get. The only think I have added to the original hello-world app is the firebase dependency. I remove that and it deploys fine again.
Updating service [default]...failed.
ERROR: (gcloud.preview.app.deploy) Error Response: [13] Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying).
Any help would be greatly appreciated.
I fixed the issue by installing the firebase npm on my local machine again. I noticed when I was installing it on the server (even with --save) it wasn't updating the package.json file for some reason and it hadn't updated it locally either. But it still ran on my local machine without the package mentioning a firebase dependency. Not sure why that would be the case.
It seems to be working now.
Before you can require the "firebase" package you need to install it.
To install the latest version of the package using the command line:
Navigate to the project root directory
Run npm install --save firebase
You will now have Firebase, and all the packages that it depends on, installed in your app.
The --save argument makes the command save the package installation configuration to the package.json file, so that the package is installed when you run the npm install command to set up the project on another computer, or when your app is deployed to Google App Engine.
You can check the logs for error. To check it goto your project at google console (console.cloud.google.com) and then Menu-> Logs.
Usually this error comes when app couldn't start while deploying. 1st check if the app local environment. If it is working fine then check if any environment variable is required to set and not set properly on cloud.

Why is `url` `undefined` in the Meteor server production environment, but not locally?

I have no clue as to why this is happening, as I can use the url.parse() method safely anywhere on the server while developing locally with Meteor.
But the moment I deploy my app (not Galaxy, but via mupx - also tried with mup before) I get an exception that url is not defined.
I know there is a separately bundled url package on Npm, but I though it was already part of Node v0.10.41 running in the Docker container?
What am I missing here?
Do I have to require it separatly?
Why is the module available locally but not on the server?
How do I require it?
Thanks in advance!

Phusion, Passenger and Old Node.js issue

I'm trying to deploy a Node.js server using Nginx and Passenger but having the following issue:
Watching the log I can see that Passenger starts the nodeserver but on the client side I've got no answer.
By the way I've followed the instructions on here: Passenger/Node.js tutorial
which is simple enough to understand.
The program versions that I'm using are these:
nginx v1.4.5
nodejs v0.8.15
passenger v4.0.37
OS ubuntu 12.04
After some tests I've tried to deploy the example server found on nodejs.org even with that I got the same situation that had with the first server. So I tried to do the same test but this time using Node.js v0.10.26 and it worked just fine, equals as the v0.8.15 passenger runs the server but this time on the client side I got response from server.
Is that issue normal?
Is there a way to deploy my server with the last version of passenger even with an old nodejs version?(because the server cannot run on last Node.js version, for that reason I'm using v0.8.15).
Thanks in advance
Phusion Passenger relies heavily on streams2, so it doesn't work on Node.js 0.8.

ruining EasyRTC server using iisnode

EasyRTC is one of the best available opensource WebRTC solutions that runs in node.js! I have manged to run it on node.js on my system but my application is in Asp.net so I've been trying to run it using under IIS using iisnode! but for some reason I haven't been able to make it work! running this application in node.js i use node server.js to start the server but in IIS when i set the default page to server.js to start the application it wond work!
this is result by using
nodejs:
nodejs result: (working properly)
IISNODE Result:
looks like it's not even running it !
This error is due to lack required module for easyRTC. type in node command prompt "npm install" It will install all dependency module. And after that try to run server. I hope It will work for you.

Resources