Closed tinypell3ts closed 5 years ago
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
try doing this (works for Windows, i don't have linux to test): step1: at your package.json add "homepage": "." step2: npm run build step3: cd build folder (or just copy(cut) it somwhere and go inside via your IDE ) step4: npm init step5: edit package.json: ... "main": "app.js", "scripts": { "start": "node app.js", } ... step6: npm install --save express step7: create app.js: const express = require('express'); const path = require('path'); const app = express(); app.use(express.static(path.join(dirname, 'build'))); app.get('/', function(req, res) { res.sendFile(path.join(dirname, 'build', 'index.html')); }); app.listen(9000); step8: create start.bat file set BROWSER=chrome.exe start %BROWSER% -new-tab "http://localhost:9000" node app.js step9: open your build folder in OS double click on start.bat
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.
Is this a bug report?
Yes
Did you try recovering your dependencies?
Yes, npm version : 6.4.1
Environment
System: OS: macOS 10.14.2 CPU: x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz Binaries: Node: 10.15.0 - /usr/local/bin/node npm: 6.4.1 - /usr/local/bin/npm Browsers: Chrome: 72.0.3626.96 Safari: 12.0.2 npmPackages: react: ^16.8.1 => 16.8.1 react-dom: ^16.8.1 => 16.8.1 react-scripts: 2.1.3 => 2.1.3 npmGlobalPackages: create-react-app: 2.1.3
Steps to Reproduce
create-react-app newapp
npm run build
Expected Behavior
The react app to work correctly in production.
Actual Behavior
The page is blank and multiple
Failed to load resource: net::ERR_FILE_NOT_FOUND
errors in console log. It works fine in development, not production. I have used create-react-app several times and have never experienced this issue.Reproducible Demo
use create-react-app and build something.