I have a built a small React application with create-react-app, and it runs fine from the local server after running npm start
. OK so far.
However, when I run npm run build
, the process appears to execute correctly (creates build folder, which contains the bundled js file and the index.html file), but when I open index.html in my browser it renders nothing. What am I missing?
Aside: I also tried uploading it to a remote server and when I went to the URL the browser came back with...
Forbidden: You don't have permission to access / on this server.
...if anyone has any idea how to resolve this I'd also appreciate it.
After building your application through
create-react-app
create-react-appRun command
npm run build
After that run commandnpm install -g serve
& finallyserve -s build
More detailed information can be found from here create-react-app-deployment