"start-client": "cross-env NODE_ENV=production node ./server/index.js",
"start-api": "cross-env NODE_ENV=production node ./server/api/index.js",
"start-pro": "concurrently \"npm run start-client\" \"npm run start-api\""
the npm run start-pro
above can be run directly on linux, but the service exists and shuts down after shutting down the current session.
when I execute the command npm run start-pro &
, I also run normally. After I close the session, the site has a 503 error. Use lsof-iVist8080
and lsof-icode 8686
to check if the port exists. It is found that the port of 8080
does not exist, but the back-end port of 8686
still exists. And then gave up the operation.
when I execute the command nohup npm run start-pro &
, the file nohup.output
appears in the root directory of the project, with the error:
> p2@0.1.0 start-pro /website/pgyer
> concurrently "npm run start-client" "npm run start-api"
events.js:160
throw er; // Unhandled "error" event
^
Error: EBADF: bad file descriptor, read
at Error (native)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! p2@0.1.0 start-pro: `concurrently "npm run start-client" "npm run start-api"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the p2@0.1.0 start-pro 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! /root/.npm/_logs/2018-07-18T00_30_14_968Z-debug.log
think of a way again, using nohup npm run start-api &
to prompt for success! Also executed successfully after executing nobup npm run start-client &
!
I am quite obsessive-compulsive. Here I would like to ask, how can I executenpm run start-api
andnpm run start-client
with one command? is there any way?