running pm2 with npm script "react-scripts start"
See original GitHub issueHi,
I am trying to use pm2 on a dev server with your npm start up script react-scripts start
Do you have any recommendations on where we could execute pm2 process on node.js running this script? normally we use pm2 start server.js --watch
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Can pm2 run an 'npm start' script - node.js - Stack Overflow
Suppose we want to run the script named as 'shivkumarscript' with pm2 utility. So, our pm2 config file should be like below, containing...
Read more >How to Build React for Production Using PM2
Follow the below steps: · 1. Create a React app (ignore 1st command if you have a project already created) · 2. Open...
Read more >How to Run a Npm Start Script With PM2 - Coder Rocket Fuel
The commands you can use to run npm scripts with the Pm2 process manager. Examples of running the commands with the --name and...
Read more >npm ERR! Missing script: "start" [Solved] | bobbyhadz
If you have a start command in the scripts object in your package.json file, make sure you are opening your IDE and shell...
Read more >How to Build a Progressive Web App (PWA) with React
Running Your Application ... In your command prompt, entering 'npm start' can spin up your application to a specific localhost url. You can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sam3k 's command failed for me but I got it to run with a slight adjustment
pm2 start node_modules/react-scripts/scripts/start.js
--name “myapp”It makes no sense to run npm start with pm2. The start script is only meant for development (because it starts a bloated development server). You need to build, then serve the app using a server meant for production, like Node with Express. Here’s what you can do:
.env
file in your root directory:server.js
in your root directory:package.json
:yarn prod