nodejs如何保持一直运行?

2020-05-12  本文已影响0人  牙齿不帅

1.全局安装forever:

# npm install forever -g
/usr/nodejs/node-v10.15.3-linux-x64/bin/forever -> /usr/nodejs/node-v10.15.3-linux-x64/lib/node_modules/forever/bin/forever
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/forever/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ forever@1.0.0
updated 1 package in 18.274s

2.运行js文件。

# /usr/nodejs/node-v10.15.3-linux-x64/bin/forever start server.js
上一篇 下一篇

猜你喜欢

热点阅读