Rails: How to configure NodeJS 16.x with Rails 6 on DeepinOS 20.7

Play this article

Revisited on December 07th, 2023


Hey guys, how have you been?

Today, we are going to learn how to configure NodeJS 16.x with Rails 6 on DeepinOS 20.7.


Introduction

Node.js® is an open-source, cross-platform JavaScript runtime environment. It works as an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications.

Node.js is similar in design to, and influenced by, systems like Ruby's Event Machine and Python's Twisted.


1 - Install the NodeSource

curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -

You should be able to see something like this


2- Install Node16 and npm

sudo apt-get install -y nodejs

You should see something like this


3 - Install Yarn (Package manager)

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
     echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn

The result would be something like this


4. Check if NodeJS is installed

Just to make sure that `NodeJs` is already installed.

which node

You should be able to see something like this


5 - Check if Yarn is installed

Just to make sure that `Yarn` is already installed.

which yarn

You should be able to see something like this


6 - Check NodeJS 's version

node -v

or

node --version

You should get something like this


7 - Check Yarn's version

yarn -v

or

yarn --version

You should get something like this


8 - Celebrate

image.png

image.png


Conclusion

That's all for today. I hope this article helped you. Let me know if you have any questions.