Run the script in the background using npm forever cmd
Installing forever
npm i -g forever
Running a script with forever
forever start app.js
After you start the script, you can list all the running processes.
forever list
Some other useful forever commands:
forever start: starts a script as a daemon
forever stop: stops the daemon script by Id|Uid|Pid|Index|Script
forever stopall: stops all running scripts
forever restart: restarts the daemon script
forever restartall: restarts all running forever scripts
forever cleanlogs: deletes all historical forever log files
forever config: lists all forever user configurations
forever set : defines a forever config value for an unique key
forever clear : clears the specified forever config by its key
Run your customize script
Navigate your file:eg /var/www/frontend
Where package.json is available
forever start -c "npm run dev" ./
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)