2017-10-05 64 views
1

when the status is online i am running the port on 8014 its still not running如何運行「故宮開始」跑永遠

when i use pm2 start tools/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" 
} 

我運行與故宮開始我需要運行的節點來運行永遠運行服務器的節點。

我試圖用「永遠啓動-c‘故宮開始’./」它沒有顯示

+1

檢查pm2永久運行你的腳本 –

+0

@ShubhamJain我附上了一個圖像,你可以檢查,讓我知道我使用的命令pm2啓動工具/ server.js狀態顯示在線但端口沒有運行,當我檢查pm2列表顯示狀態錯誤 –

+0

您的項目是否有任何github回購?我無法從這裏調試問題。 –

回答

0

要運行npm startpm2您可以運行pm2 start npm -- start。這將運行寫在package.json start部分中的任何命令。

+1

這隻適用於Linux,但不適用於Windows 10 –

0

你爲什麼不嘗試使用PM2(節點進程管理器:http://pm2.keymetrics.io/)命令?

+0

我已經安裝了pm2使用npm install pm2 -g 。 永久運行服務器的命令是什麼。 –

+0

pm2 start'文件名' –

+0

如果您在問題中詢問我正在運行多個腳本的腳本中看到了什麼命令 –