How to Install Node Modules on Cloudways via NPM

After getting huge positive feedback on our last post in regards to installing a Nodejs application on Cloudways. we got tons of questions on how we can install and use some modules like pm2, bower, gulp etc on Cloudways. So in this post, we are going to share how you can install some packages on your Cloudways server.

We will assist you in the process of installing/using a Node module globally on your server, this is the best and the easiest way to run these packages. Kindly note that you can install, run and manage these modules via your server’s master user only, this guide is not applicable to application users.

Pre-Step: Customize your Shell Environment via .bash_aliases

Before we install any node modules on your Cloudways server the first thing is to customize your Shell Environment using .bash_aliases. Bash alias is a method of supplementing or overriding Bash commands with new ones. Now simply copy-paste the commands below on your server after logging in the server via SSH.

Installing node packages globally via NPM

Now we will start installing node modules via NPM, we will cover the popular modules in our guide and if you have any other Node module that’s not mentioned on the list you can simply alter the mentioned commands to install your own module.

Installing Bower

Bower is another package manager. Bower can manage components that contain HTML, CSS, JavaScript, fonts or even image files. Bower doesn’t concatenate or minify code or do anything else – it just installs the right versions of the packages you need and their dependencies.