I tested with a simple app generated by
npx create-react-app myfirstreact
It works fine with
npm start
but if I try to run it in the background with
nohup npm start &
I get
Starting the development server...
events.js:174 throw er; // Unhandled 'error' event ^
Error: EBADF: bad file descriptor, read Emitted 'error' event at: at lazyFs.read (internal/fs/streams.js:165:12) at FSReqWrap.wrapper [as oncomplete] (fs.js:467:17) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start:
react-scripts startnpm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in: npm ERR!
/home/jglickman/.npm/_logs/2020-10-06T04_43_39_480Z-debug.log
nohup node server.js </dev/nulljoshua@joshua-KVM:~/git/test/myfirstreact$ node server.js internal/modules/cjs/loader.js:638 throw err; ^ Error: Cannot find module '/home/joshua/git/test/myfirstreact/server.js' joshua@joshua-KVM:~/git/test/myfirstreact$ cd src joshua@joshua-KVM:~/git/test/myfirstreact/src$ node server.js internal/modules/cjs/loader.js:638 throw err; ^ Error: Cannot find module '/home/joshua/git/test/myfirstreact/src/server.js'