How to run server with loopback?
I have access to a Project backend and would like to know how do I make run that project. It uses loopback
and when reading the documentation of the loopback
, in the statement 4 it says:
Start the web server.
Which command should I use in Ubuntu to start this webserver
with loopback
?
After running the command npm install -g loopback-cli
and trying to run the system with node .
or node server.js
appears this error in terminal:
2 answers
As mentioned by @Sergio in the comments, just run the following command:
npm install
You can see more information in StackOverflow.
Loopback is a node-based application that uses packages as dependencies and is controlled via npm. Therefore, the application needs its dependencies to be initialized.
To install the dependencies of an application in NodeJS, you can run the npm install
Command, which will install all the dependencies of the application.
Or in case of production, I recommend npm install --production
, which avoids installing packages needed only for dev.
After running the installing the dependencies, you can run the application via node .
or npm start
.
I recommend using npm start
in case of dev., because it may have extra scripts for correct execution of the same (you can analyze this by looking at package.json
, in the scripts -> start session.