How to run server with loopback?

Asked

Viewed 63 times

1

I have access to a project backend and would like to know how I do to rotate this project. It uses loopback and when reading the documentation of loopback, in instruction 4 says:

Start the web server.

Which commando should use in the Ubuntu to begin this webserver with the loopback?

After rotating the command npm install -g loopback-cliand try to run the system with node . or node server.js this one shows up ERROR in the terminal: inserir a descrição da imagem aqui

  • node server.js runs the file, or you want to know how to have it autonomously to start when you have problems or the server reboots?

  • See if this is http://loopback.io/getting-started/ and this is https://loopback.io/doc/en/lb3/Running-and-debugging-apps.html help

  • @Sergio when I try node server.js message appears: loopback modules not found

  • You can put the error in the question?

  • @Tmc I installed the loopback as it talks on the first link and tried to run using the node . but says that the loopback module not found. You know what it might be? And I circled the remote npm install -g loopback-cli

  • @Sergio yes, just a moment!

  • @Sergio edited question!

  • You got that package on package.json? If it doesn’t npm install --save loopback. If you’ve got it npm install.

  • @Tmc I edited the question by posting the error.

  • @Sergio I needed to have rotated the npm install really! It worked, thank you!

  • @Tmc worked when I read that question you sent, thank you!

Show 6 more comments

2 answers

1


As mentioned by @Sergio in the comments, just run the following command:

npm install

You can see more information on Stackoverflow.

0

Loopback is a Node application that uses Packages as dependencies being 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 command npm install, that will install all dependencies of the application.
Or in case of production, I recommend the npm install --production, which avoids installing Packages needed only for dev.

After running the dependencies installation, you can run the application via node . or npm start.

I recommend using the npm start in case of dev. as it may have extra scripts for correct execution of it (You can analyze this by looking at package.json, in the -> start script session.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.