yn1043
yn1043

Reputation: 588

-bash: node: command not found (on EC2 instance)

I've encountered problem that I can't use node command.

I've created an instance of EC2(AMI: Amazon Linux AMI 2017.03.0 (HVM), SSD Volume Type)

And then I installed packages...

[ec2-user@ip-172-31-29-213 ~]$sudo yum -y install git gcc-c++ make openssl-devel nginx

[ec2-user@ip-172-31-29-213 ~]$git clone git://github.com/creationix/nvm.git .nvm

[ec2-user@ip-172-31-29-213 ~]$source ~/.nvm/nvm.sh

[ec2-user@ip-172-31-29-213 ~]$nvm install v6.10.3

[ec2-user@ip-172-31-29-213 ~]$node -v
v6.10.3

And then, I build a node.js web system. I was able to access the system.

But,After having a break(for about 2 hour), Node command became not working...

$ [ec2-user@ip-172-31-29-213 ~]$ node -v
-bash: node: command not found

Please tell me what is the cause of it.

Upvotes: 2

Views: 1400

Answers (1)

yn1043
yn1043

Reputation: 588

I've resolved by below command.

source ~/.nvm/nvm.sh

Thank you all for your kind response.

Upvotes: 0

Related Questions