Preview won't work - "Could not find an open port"


#1

When working locally outside of Cloud9 I would use npm run start && open http://localhost:3000 to run my NodeJs app locally. How to get it to work in Cloud9 IDE?

If I run npm run start in Cloud9 and then go to https://appname-username.c9users.io/, I get the error:
“Invalid Host header”. Therefore, based on the instructions here I first define the host and port:

  1. export HOST=$C9_HOSTNAME && export PORT=8080
  2. npm run start

This however still generates an error:

Could not find an open port at appname-username.c9users.io.
Network error message: listen EADDRNOTAVAIL 35.195.221.140

I understand from here that 8080 is the right port. Or has this changed? I’ve also tried ports 8081 and 8082 but with the same result. What am I doing wrong?


#2

Anyone?? I effectively can’t use Cloud9 as it is now… :frowning: