简体   繁体   English

如何运行“ npm start”永远运行

[英]How to run “npm start” run forever

when the status is online i am running the port on 8014 its still not running 当状态为在线时,我正在8014上运行端口,但仍未运行

when i use pm2 start tools/srcServer.js 当我使用pm2启动工具/srcServer.js时

"scripts": {
"prestart": "babel-node tools/startMessage.js",
"start": "npm-run-all --parallel test:watch open:src",
"open:src": "babel-node tools/srcServer.js",
"test": "mocha --reporter progress tools/testSetup.js \"src/**/*.test.js\"",
"test:watch": "npm run test -- --watch",
"clean-dist": "npm run remove-dist && mkdir dist",
"remove-dist": "node_modules/.bin/rimraf ./dist",
"build:html": "babel-node tools/buildHtml.js",
"prebuild": "npm-run-all clean-dist test build:html",
"build": "babel-node tools/build.js",
"postbuild": "babel-node tools/distServer.js"
}

I am running the node with npm start I need to run the node to run run the server forever. 我正在使用npm start运行节点,我需要运行节点才能永远运行服务器。

I tried using the command "forever start -c "npm start" ./" its not showing 我尝试使用命令“ forever start -c“ npm start” ./“不显示

您为什么不尝试使用PM2(节点流程管理器: http : //pm2.keymetrics.io/ )?

To run npm start from pm2 you can run pm2 start npm -- start . 要运行npm startpm2可以运行pm2 start npm -- start This will run any command that is written within package.json start section. 这将运行在package.json开始部分中编写的任何命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM