Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (13.1k points)

When I tried to run the npm build command it gives the following error:

You need to enable JavaScript to run this app

Can anyone help me with this?

1 Answer

0 votes
by (26.7k points)

You can try the below command, this will help you to run the app:

"homepage": "."

For index.js:

app.use(express.static(__dirname)); //here is important thing - no static directory, because all static :)

app.get("/*", function(req, res) {

  res.sendFile(path.join(__dirname, "index.html"));

});

I hope this will help.

Want to know more about Java? Prefer this tutorial on Java Tutorial.

Want to become a Java expert? join Java Certification now!! 

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...