why meteor app is not runing in my ubuntu OS - node.js

i have installed meteor js but when i going to run any app using command meteor it gives me an error like this.
'/home/user2/.meteor' exists, but '/home/user2/.meteor/meteor' is not executable. Remove it and try again.
snapshot

Related

Weird PM2 - NodeJS Version Behaviour

I am experiencing a weird bug with NodeJS's File System module, where the remove directory function is asking for a callback, despite there being one. Having a look, it turns out this is a bug with NodeJS that was resolved in later releases
I tried to update the server's nodeJS version, except, as NVM was reporting, it was already fully updated.
Using the pm2 show APP_NAME command, I determined that PM2 was running the app in NodeJS v10.19.0, and all steps to update it were fruitless.
So how can I fix this?
Notable Details:
DigitalOcean Ubuntu 20 Droplet
PM2 Installed
NodeJS v16.15.1
NVM Installed
In order to resolve this issue, I had to kill the current in memory version of PM2, and go to the following directory as root:
~/.nvm/versions/node/v16.15.1/bin in there is a pm2 executable.
In order to get the application to run in Node v16.15.1, I had to run the following command ~/.nvm/versions/node/v16.15.1/bin/pm2 start index.js --name APP_NAME, and then and only then did it run the application properly.

Pm2 starts the process but node app inaccessible

I'm new to PM2 and nodejs, I'm trying to learn node by following simple sample that creates a server that displays 'Hello World' from the browser. Please note that I'm running node on QNAP NAS. I have successfully installed nodejs, npm, and pm2. when I run app.js via node app.js, it works and I see the message using the port specified.
but when I run via pm2 start app.js, I got this
Then after a few seconds I got status = errored
when I look at the log I got this.
I tried searching in google but the result were pointing to old version of node which I don't
Node itself has to be built with inspector. You can try to install LTS version of node.
Alternatively, you can try installing node-inspector with npm i node-inspector --save

Install React JS on Cent OS

I am very very new to React JS and have tried to install it on my VPS server that is running Cent OS.
Node.js seems to be working,
I have build a React project using the following code as a root level user on SSH:
npx create-react-app my-react-project
cd my-react-project
npm start
but when trying to view in browser I get a blank page (instead of react js default template)?
I see many people install this locally but I haven't found any examples on a hosted VPS, is this something I am doing wrong?
Any help would be much appreciated, thanks!
if you have ssh access to your VPS, the rest is pretty the same as your local environment.
You can copy/paste your project to your CentOS host and use the following commands in order to run it:
cd your_project_folder_which_includes_package_json_file
npm install
npm start
Also, if you are using this server as a production host, You should consider getting a production build of your React app on your local env by running npm run build and then publishing the build folder on your server and serving it using a static file server or using a reverse-proxy such as Nginx as a static server.
Actually this page in React documentation does a good job in explaining the details of deploying a React app, I encourage you to take a look at it.

How to check which user Phusion Passenger chooses to run node.js?

What is the best practice for using Phusion Passenger with a version of node installed my nvm?
In this tutorial on using Passenger to run a Meteor app, I read:
[Y]our Meteor application is run as ... the owner of the
main.js file (when deploying a Meteor bundle), unless you configure it
otherwise. Of course you still have to make sure that each of your
applications is owned by another user.
Meteor 1.6 works with Node.js v8.8.1, so I have used nvm to install node. I created a special meteor user to run the nvm installation of node and nvm. Node was therefore installed at /home/meteor/.nvm/versions/node/v8.8.1/bin/node, and /home/meteor/.nvm/versions/node/v8.8.1/bin/ was added to the $PATH variable for my meteor user. As a result, calling node -v as the meteor user showed that v8.8.1 was installed and accessible.
I followed this tutorial to deploy my Meteor app to my server.
As the meteor user from within the bundle/programs/server directory, I ran npm install --production. I made meteor the owner of everthing inside bundle/.
I had expected that Passenger would launch node as the meteor user, and that everything would run smoothly. Instead, Passenger showed a useful alert page, apologising that "something went wrong".
To work around this, I created a symlink at /usr/bin/node to point at /home/meteor/.nvm/versions/node/v8.8.1/bin/node, and now Passenger was happy to launch the bundled app.
This suggests to me that Passenger was not running main.js as the meteor user. Or is there another reason why the meteor user was not able to see its own version of node?
The quote above suggests that it is possible to configure which user Passenger uses. How do I do that?
In a nutshell: what is the official Passenger method for working with a version of node installed by nvm?
You'll want to set the version of node to the full path to the nvm node: https://www.phusionpassenger.com/library/config/standalone/reference/#--nodejs-nodejs
As for the user-switching, you can set the log-level to 7 (https://www.phusionpassenger.com/library/config/standalone/reference/#--log-level-log_level) in order to debug that and either go through the startup logs yourself or post them here.

How can I install nodejs modules to appfog

Normally in local, I use cmd, command line to install any nodejs module using "npm install testing or connect or etc.."
But I decided to use appfog as server and I add nodejs to my project on appfg but probably I am gonna need some nodejs modules like testing, connect, request etc..
The problem is I couldnt found tool like cmd on appfog or any way to add nodejs modules.
How can I do this?
Basically, you just need to install the dependencies in your local environment and everything should be just fine. Simply specify all of your dependencies in your package.json file, run a typical npm install, and if the modules are properly installed in your local environment then they will be pushed to AppFog when you run af update.
You just have to develop your application on your local machine with all the required dependencies in the json package and modules in the Node.JS. And if your application is working properly at that time on your local machine then you can push all that application data to the AppFog using command line interface. Simply use the command af update <your app name> Then start the application and you will see that everything is working properly.

Resources