In order to install Sails, you’ll first need to install Node.js. Node is supported on most major operating systems, including MacOS X, Windows, and many flavors of Linux. The website has pre-built installers for plenty of platforms, so you can just hop on over to the downloads section of nodejs.org and choose the one that’ll work for you.
Find my node installerTo install Sails:
npm install sails -g
This usually takes about 48 seconds. It’s a good time to grab a cup of coffee or tea. Or if you’re on slow internet, maybe something a bit stronger.
If you run into any trouble running NPM, ask for help.
To generate a new app, just cd
into the directory where you want it to be, and type:
sails new test-project
You'll see a prompt to choose your project template:
Choose a template for your new Sails app:
1. Web App · Extensible project with auth, login, & password recovery
2. Empty · An empty Sails app, yours to configure
(type "?" for help, or <CTRL+> to cancel)
?
Type 1
(or press enter) to start with our "Web App" template: an opinionated starter project that includes essential features like login, password recovery, and emails. Or, if you want to start from scratch with an empty project, choose 2
for a classic Sails app.
Once you've chosen your template, you'll need to wait a moment for some dependencies to install:
info: Installing dependencies...
Press CTRL+C to cancel.
(to skip this step in the future, use --fast)
info: Created a new Sails app `testproj`!
Then, to take a look at your new Sails app:
cd test-project
sails lift
Now you can go to localhost:1337 to see your brand new homepage.
Your project is ready for whatever you want to create. But in case you’re not sure what to do next, here are a few resources that will help get you acquainted with developing on Sails: