Install NodeJS and Npm On Ec2

Just like smooth like Butter ๐Ÿงˆ


2 min read

HEY, Gorgeous people on the internet. Today, let's go through an article where the success rate of completing this task is close to 50%, which is installing NODEJS and NPM on an AWS EC2 Instance ๐Ÿ˜œ๐Ÿ˜œ.

Yes, you have read it right, I have seen many people on stack overflow complaining about this. So passengers pull up your seat belts let's do this and remove this problem from the AWS Community.


After you have successfully launched your AWS EC2 Instance take the power of being the root user.

sudo su



Make sure you are the root user while doing the below steps because the packages that you install now will only be accessed by the profiles that installed them.


Copy this command and paste it into the terminal.

curl -o- | bash


Once you have done you will be seeing the message asking you to close the terminal. So enter this cmd.


this brings you out of the root user. again put cmd

so that you will be disconnected from your ec2 instance and now the most important part.

Close your terminal most people miss this and they get into some weird kind of errors.

After 20- 30 seconds try to connect your EC2 instance.

#### STEP 3:
Now again get root user power by
```sudo su

Now we need to activate the NVM

#### STEP 4:
 Now Install the NODE

```nvm install 15.0.0

After running this command you will be seeing something like this...


And that is it you have successfully installed NodeJs and npm on the Ec2 Instance.

To confirm type this cmd in the terminal:

node -e "console.log('Running Node.js ' + process.version)"


and that's it we have successfully Installed Nodejs and Npm.


And that is it my friend that's how you install Nodejs and NPM on Ec2 just like smooth like BUTTER ๐Ÿงˆ.

Arigato Guys

Did you find this article valuable?

Support SYED IMAM by becoming a sponsor. Any amount is appreciated!