0

I've created a webpage that opens when user types npm start. The localhost was fine the whole day. For the pas few hrs it refuses to connect. I've tried restarting pc, clearing cache, and turning off firewall and nothing is working.

here is my scripts

"start": "npm run open",
"open": "start http://localhost:1234"

It was working the whole day and now it's just broken. I've also tried removing all the json packages and reinstalling and running and nothing is working. Is there a different way to do this? I want the html file to run and open automatically.

Danzz
  • 127
  • 1
  • 1
  • 6
  • is `start` an npm package that you can run? if you try `./node_modules/.bin/start http://localhost:1234` after `npm i` does it do what you're expecting? – balexandre Feb 01 '21 at 02:18
  • @balexandre I'm not sure what you mean by this, with npm install, I installed http-server and thats it – Danzz Feb 01 '21 at 03:25
  • so, what is `start` in the `start http://localhost:1234` line?... those are command lines, and that's the same as you run the command in the terminal... my question is, what is `start`... I think you're confused about how scripts work – balexandre Feb 01 '21 at 08:52
  • @balexandre I'm new to node js so I'm not really sure, this snippet from scripts is mainly from the second answer from https://stackoverflow.com/questions/40713752/how-to-open-browser-to-localhost-through-npm-scripts. It worked for the entire day and then stopped working entirely – Danzz Feb 02 '21 at 06:52

0 Answers0