En windows tira este error cuando se corre el comando “sails new backend …”
"sails" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable
Introducción
Qué aprenderás sobre API con Sails.js
Presentando el proyecto
Comenzando con Sails
Introducción a Sails.js
Estructura de archivos
Preparación del ambiente de desarrollo
Setup de Espacio de Trabajo
Generando rutas REST con blueprint
Instalación de MongoDB
Conexión a Mongo
Instalar MySQL y usarlo con Sails (a través de WaterLine)
CRUD
Entendiendo operaciones CRUD
Crear modelo de rodada
Crear app de Ionic
Obtener todas las Rodadas: preparando la aplicación para mostrar datos
Obtener todas las Rodadas: mostrando los datos
Crear Rodada: recibiendo parámetros desde la URL
Crear Rodada: enviando información desde el formulario
Actualizar Rodada
Eliminar Rodadas
Autenticación y Usuarios
Obtener Rodada
Crear Modelo y Controller de Usuarios
Implementar validación de modelo
Nueva versión de la librería Joi
Crear Usuario
Cifrado de contraseña
Implementación de Login
Sistemas Externos
Uso de JSON Web Token
Policies: verificar si usuario está loggeado
Agregar usuario a Ride
Preparando la App para implementar el Login y Sign up
Implementando Login
Implementando Sign up
Agregar puntos de Rodada
Obtener API Keys para Clima y Distancias
Integración Google Geocoding: definiendo la lógica
Integración Google Geocoding: probando la funcionalidad
Integración Weather API
Desplegar clima, distancia y tiempo en cada punto de Rodada
Cierre
Cierre
Create an account or log in
Keep learning for free! Join and start boosting your career
Application development requires preparing a suitable environment. Choosing tools and understanding their installation are vital steps to achieve an effective workflow. In this article, we will explore how to start a project with Node.js, from installation to the basic structure of a project.
To begin with, we visit the official Node.js website, as here we can download the version that suits our operating system. For example, if you use a 64-bit Mac, you will be shown the optimal option for your device. The process is simple: download the installer and follow the installation steps that include several clicks on "next".
Verify the installation:
npm -vIn
this example, the version of npm
is 6.2.0. Yours may vary, but the process is similar.Now that you have Node.js configured, it's time to install Sails.js, a framework that makes it easy to build web applications. Use the following command in your terminal:
npm install sails -g
The installation will depend on the speed of your Internet connection and the processing power of your computer, but it should not take more than two minutes.
Sails.js installation verification:
sails -vThe
output will show you the version of Sails.js installed.With Sails.js installed, we can proceed to create the basic structure of a project. First, we need to create a directory where we will host our project. Use the following command:
mkdir platzi-right
With this command, we have created a new directory called platzi-right
.
Browse and generate the Sails project:
cd platzi-right
.sails new backend --no-frontend
This will create a new Sails.js project in backend mode, avoiding generating the controlling view model (MVC) for the frontend.Once the project is generated, it is time to explore its structure and configure it properly:
platzi-right
, and select the project named backend
that we just created.The project should show folders like:
api
: This is where you will write most of your code.config
: Contains default configurations adjustable according to the needs of your project.node_modules
: Stores the libraries needed for the application to work.To test the configuration and operation of your development environment, you can start the Sails.js server:
backend
directory.sails lift
If everything is configured correctly, you should be able to navigate to http://localhost:1337/
in your web browser. If you see the message "Cannot find", that means everything is working fine with the installation.With these steps, you now have a basic understanding of how to start a Sails.js project with Node.js. This start will allow you to go into web development with confidence, handling each component efficiently. Continue exploring other modules and platform enhancements to enrich your programming skills.
Contributions 11
Questions 0
En windows tira este error cuando se corre el comando “sails new backend …”
"sails" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable
En Mac si les aparece un EACCES error, prueben esto:
sudo npm install sails -g --unsafe-perm=true --allow-root
Para instalar sails global
npm install sails -g
Una alternativa, si como a mí no te gusta instalar cosas en el global, puede ser usar
npm i sails
Y posteriormente usar los comandos antecedidos de “npx”, ejemplo sería
npx sails lift
A mi me gusta instalar la version exacta de mis librerias, esto se hace con el flag -E
Ejemplo
npm install sails -g -E
VIM o Nano
✌
Para los que estamos con WSL Ubuntu, tenemos que instalar con sudo
sudo npm install sails -g
Buenas noches, se crea un proyecto totalmente vacío o la opción de Web App?.
PDT:Yo uso gitbash y no tengo problemas en colocar los mismos comandos que el profe(Uso W10)
Parece que ya no sale “Not found” si no que sale esta página:
Correr nuestro proyecto
sails lift```
Want to see more contributions, questions and answers from the community?