Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cannot GET / on starting the application #52

Open
hari-nandanan opened this issue May 2, 2023 · 7 comments
Open

Cannot GET / on starting the application #52

hari-nandanan opened this issue May 2, 2023 · 7 comments

Comments

@hari-nandanan
Copy link

I have started the application using yarn install and yarn dev (also tried npm start and npm run dev). On accessing localhost on the browser it shows Cannot GET / (attached the screenshot of terminal and browser). How can this be fixed? Thank you!

Screenshot_130
Screenshot_131

@Shanmukhsvstp
Copy link

Hello sir, I have faced the same issue. But you can see that error shows that "NODE_ENV" is not recognized.
So, you can install it in that project by following command - "npm install -g win-node-env". Then try "yarn run dev".
That worked for me and also should fix your issue

@kkartik07
Copy link

@Shanmukhsvstp For me it started on localhost:8000 but nothing is showed now, it shows site can't be reached. Pls help

@Shanmukhsvstp
Copy link

@kkartik07 ,
May be something chaged in your code. pls could post it here?

@Shanmukhsvstp
Copy link

Shanmukhsvstp commented Nov 9, 2023 via email

@koudous25
Copy link

@Shanmukhsvstp had you have a solution?

@Afrin127329
Copy link

I was able to run the app locally by making these changes:

  1. create a .env file on the root directory and add these variables:
    PORT=8000
    NODE_ENV=dev

  2. npm i dotenv

  3. on app.js
    let env = require("dotenv"); env.config();

  4. change process.env.NODE_ENV === "dev" on app.js & server_url= http://localhost:8000

  5. Run yarn build manually for creating static build file

  6. Then run yarn dev

Hope this helps🙂

@Shanmukhsvstp
Copy link

Shanmukhsvstp commented May 24, 2024 via email

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@koudous25 @kkartik07 @Shanmukhsvstp @hari-nandanan @Afrin127329 and others