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.
Related
Here is my problem, I am dealing with it for a days, and any help is greatly appreciated.
I am developing a project using Laravel, on a Windows 10. I have installed NodeJS, NPM works just as expected, and also when I check node -v through CMD or PowerShell it shows current version.
So, my environment variables are placed where it should be, and works properly.
But the problem is, whenever I try to use some package in Laravel that relies on node, it shows me "node is not recognized..." Examples that occur this problem are spatie/browsershot, rialto-php/puphpeteer, and many other that relies on puphpeteer or on node generally.
Once again, my environment variables are set, but maybe they are not provided to Laravel or something like that?
Any ideas about this..
Thanks in advance!
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.
I have a working react app that I had hosted on a linux environment, but the client has switched their hosting provider and now I have to run the app on a Windows environment. I personally am unfamiliar with Windows and having some serious issues getting my app to work now.
After loads of debugging and testing I now can get my app to run, but when I start it, it will throw some errors which will results in a broken app in the browser.
So when I run npm start it will start up the app and spit out this error:
Screenshot of the terminal error 1/2
Screenshot of the terminal error 2/2
It seems to spit out some complaints when using npm run watchJS which runs this command babel src --watch --out-dir lib.
I am completely lost at this point and have no idea where to go from here.
I can provide as much detail as anyone needs after looking at the question, I just don't know what else to add to this issue and don't want to fill up this question with irrelevant info.
Thanks in advance for any help
It is likely a bug with the version of npm you are using.
See this thread:
https://github.com/npm/npm/issues/18380
Try rolling back your version of npm to 5.3
The issue appears to be exclusive to windows with babel packages.
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.
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!