Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node.js commands on AWS elastic beanstalk ec2 server

I created an elastic beanstalk node.js app on AWS, which created the EC2 and RDS server for me. I am using putty to connect to my Linux EC2 instance, which is successfully logged in.

But the following command doesn't work:

node -v
npm install express -g
node

it gives me an error:

bash: node: command not found

like image 561
Amin Ahmed Khan Avatar asked Mar 08 '14 08:03

Amin Ahmed Khan


2 Answers

Node is automatically installed on your instance for elastic beanstalk. It's not in the path.

Look for node installation under /opt/elasticbeanstalk/node-install/ folder.

You shouldn't be installing modules from command line. The preferred way to install node modules on elastic beanstalk is thru package.json. Dependent modules are automatically installed on the instance by aws.

like image 58
palanik Avatar answered Sep 27 '22 17:09

palanik


you should find out which node version is being used right now. Then you can use that in your PATH and use npm/node binary..

grep node /var/log/nodejs/nodejs.log

export PATH=$PATH:/opt/elasticbeanstalk/node-install/node-v6.11.5-linux-x64/bin/
like image 24
Kapil Aggarwal Avatar answered Sep 27 '22 18:09

Kapil Aggarwal