Why the app.js isn’t being used properly when the react app is deployed on the server?

When this react app is being deployed on the server which is an ubuntu linux machine server, whenever i run “npm start”, it always only renders index.html, which means it only returns page title.

When I tried to test on some sample code which was generated by the command of “npx create-react-app test”, it also only renders index.html

However, on the local machine, when i run it, it can deploy the whole app successfully, –
which means the index.js would be associated with index.html and app.js because of this line of code
ReactDOM.render(<App />, document.getElementById('root'));

But why it wouldn’t work in this way on the ubuntu linux machine server?

Also I have generated the “build” folder with using the command of npm run build, but i am not sure does this have anything to do with the problem? and how should I run the command after the “build” folder is created?

Source: StackOverflow