Nodemon loads index from directory but does not open index

Asked

Viewed 129 times

0

I have a problem using Nodemon, whenever I start or restart the server for it instead of printing something on the console or load a page it is only in the directory Index. It takes several minutes for it to finally respond and load the page or respond to a console log request.

  • 1

    How are you doing the command of nodemon? I believe this is happening because you have no index at the root of your project or you do not pass any file as parameter to nodemon, ex: nodemon ./server.js

  • I am using the "nodemon server.js" command. So much so that in the console it starts the server (I have the server port printed), but it takes a few minutes for it to respond to any request from me. I’m using express, Hbs and Helmet

  • I don’t know if the problem could be nodemon, in doubt tries to use the live-server. Just to make sure you try using the command with ./(I don’t know if it will be different), like this: nodemon ./server.js...

  • Using " . / " solved the problem by the looks of it. I will continue to do more tests while programming but thank you from now!

  • He must have thought server.js is a command, so when you put ./ implied that it was a file of yours.

1 answer

0


As Max Rogério answered in the comments of the question, the lack of ./ before the file or the . js path to be set was causing the error. To fix just add the ./ before filing. Ex: nodemon ./server.js

Browser other questions tagged

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