How to install node.js on User Level – CentOS RHEL Amazon Linux

This article explains how you can install node package on user-level without having root access.

This method was tested on CentOS 7 and Amazon Linux 2. However, this method should work on any Linux version. Please comment below if you are facing any issues.

    • Create a user for your node application. In our case and its nodeapp1, and switch to the user.
      useradd nodeapp1
      su - nodeapp1
    • Nov install the Node Version Manager (nvm) from the user.
      curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
    • Activate nvm with the below commands
      ~/.nvm/nvm.sh
    • Install node with the below command
      nvm install node
    • Now, let’s check the node version and verify the installation
      node -v
    • So, now you have installed the latest version of node.js to the user level. v16.6.2 in my case.
      [nodeapp1@ip-172-31-19-167 ~]$ node -v
      v16.6.2
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Scroll to Top