mern stack deployment issue using cPanel - node.js

Deployment is planned to be done using cPanel. I'm facing a issue in cPanel saying that Error: "can't acquire lock for app". This is error is raised when I run my website Node.js files. I'm able to successfully run a test app.js file but unable to run my website's app.js file. The website is developed using MERN stack.

I ran into this while trying to get my MERN stack deployed. (My app still isn't deployed, God help me, but I know the fix for the lock issue)
The cPanel support staff helped me with this. There's a .lock file that was generated in your /home/username file directory (cPanel File Manager).
.lock has to be deleted.
Mine was located in /home/username/nodevenv/repositories/appname
Check your root directory for a nodevenv directory and follow the breadtrail from there.
Just delete it and that should fix your problem.

Related

index.html not found while deploying MERN app to render.com

I was trying to deploy my MERN based E-commerce website on render.com, after the render terminal shows the build was successful the the webpage shows the error as,
{“message”:“ENOENT: no such file or directory, stat ‘/opt/render/project/src/frontend/build/index.html’”,“stack”:null}
I’m a complete beginner to render and MERN too,
I have no bulid folder in my local
then I tried to create another test app by npx create-react-app test to check if build folder is actually present in there or not, But it is not there, I’m totally in Confused now…
I’m Giving my repo here → stunning spark
I just want to have clear answers for my questions(Please!!!)
Things I want to change in my directory to deploy and host my app Successfully.
Things Need to be configured in the render’s settings
Thanks in Advance!!!
I just want to deploy and host my application on render.com
Just run npm run build into your frontend folder and do check you have removed the "build" keyword from the .gitignore file because it won't let you push the build folder to GitHub and you are good to go.

Node project error 'internal/modules/cjs/loader.js:888' on Vps OVH

i have nodejs project work well in local but when upload it on Vps i find this errors
The cause of the error is stated right there in the console. Cannot find module ../modules/user. You are referencing a file that does not exist. The file may exist in your local environment but does not exist in your vps or does not exist in the same directory as referenced.

npm-bundle doesnt work behind firewall but works fine in personal laptop

When I try to bundle the node test suite project using npm-bundle for devicefarm Appium Node Run,
it is creating .npmbndle folder at the root of the project and an empty node_modules folder.
It works just fine in personal laptop, attached screenshot of logs.
If I'm reading these logs correctly, then they're saying that npm-bundle cannot find your package.json file, which is essential for telling it which packages to bundle. Can you confirm if this file is in the local directory in which you're bundling? If so, can you post your full logs pasted as text here?
Thank you,
Jon

How to install etherpad-lite on cPanel (shared hosting)

My hoster allows to install node-js applications by using cPanel. I tried to install etherpad-lite, but once visiting the URL of the app, the app isn't working, just this notice is thrown out "It works! NodeJS 11.15.0".
Here's a screenshot of the cPanel:
As you can see, there's no package.json file in the directory. Maybe here's the issue? I just cloned the git repo as indicated in the installation guide, which results in the following file structure on my server:
I am aware of this very similar question, but since it was posted in 2015 and still has no suitable answers, I issued a new and more specific question with more information.
I hope someone can point me into the right direction.
Application start up file should be "src/bin/run.sh" (from root folder). This will install all the dependencies and start the server.

Getting 'Cannot GET /' when trying to connect to localhost:5000 Firebase

I am trying to get my localhost server on Firebase to work but I am continuing to get the following message in the browser 'Cannot GET /'. I took a look in the console and all it says is 'http://localhost:5000/ 404 (Not Found)'.
I have tried re-running the server using 'firebase serve' and that doesn't help.
I ran 'firebase init' again and that didn't help either.
I re-installed the firebase tools by running 'npm install -g firebase-tools' and then running firebase serve again and still nothing.
Not sure whats going on because it was initially working. I installed some grunt plugins and moved my index.html file under an html folder although I still have an index.html file under the public folder it still says 'Cannot GET /'
I have also tried in different browsers restarting them etc.
I am using a Mac OS X El Capitan.
Let me know if you need any more info. Thanks in advance
I had this issue running firebase serve from within the scripts directory in the "Friendly Chat" tutorial. Starting the server from the parent directory got it working again as expected.
if this will help someone save time.. a possibility: it could be that the build step did not complete, this was my case, and the build/... directory had no index.html
I had the same issue when was trying to serve an Angular application with the firebase command.
Firstly, you should see the firebase.json file.
It should contain the "public" value, like:
{
"public":"dist/ProjectName"
...
}
But the dist folder will be auto created only after you build the Angular project:
ng build --prod
After you can do the:
firebase serve
Hope it will be helpful for beginners.
Ok so got this working but pretty much had to start from scratch again. I deleted the public folder and just moved my html, css, js, and node-module folders out of my project directory and then re-installed firebase-tools and ran the 'firebase init' command and then restarted the localhost server and everything started working again. After which point I moved back all my previous folders and things are working as before.
Not a 100% sure how the issue happened but at one point I did delete my index.html file and then put it back in later on as I was testing something. At which point I feel the issue started. I will try to test this scenario in a test project but I guess for the time being don't delete your index.html file just modify the existing one. Thanks all.
The error message shows up if you run 'firebase serve' within the project folder.
Navigate to the parent folder (up one level) using 'cd ..' and start the server from there.
Please check if content of your website is present in folder
"hosting": {
"public": "<folder with your website files>",
from your config "firebase.json"
If you like me, before overthinking the problem, make sure you provided the correct URL to index.html.
In my case, I didn't take into account different structure of my directory. You should provide the path to index.html relative to the root directory of your firebase project. For example, in my case, the correct URL was http://localhost:5000/button-component/public/

Resources