How To Install Sails.js With NPM - In this post, we will learn how to install Sails.js with npm. Sails.js is one of the MVC web frameworks built with Node.js, express.js, and Socket.io. To find out more about Sails.js, you can open the Sails.js website.
Before installing Sails.js on your computer you must first install Node.js and npm.
How To Install Sails.js With NPM
Step 1: Install Sails.js
Open the terminal and type the following command line:
Note: if you use Ubuntu, you can include sudo.
$ npm install sails -g
Step 2: Create a project
$ sails new test
|Picture of creating Sails.js project|
In the command line, we will create a project with the name test. Next, we will be asked for the template selection in the form of a web app or empty. When finished, Sails.js creates the project folder test and generate the files.
|Picture of the folder structure Sails.js project|
Step 3: Run the project
To see the results of the Sails.js project, we can open a browser and type 127.0.0.1:1337 in the browser address bar.
$ cd test $ sails lift
|Picture of Sails.js project on the web browser|
Sails.js is one of the MVC web frameworks built with Node.js, express.js, and Socket.io. For Sails.js installation, we can use NPM (Node Package Manager). After the installation is complete we can create a project with Sails.js. To run the project we can type sails lift and we can see through the browser by typing 127.0.0.1:1337.