【问题标题】:nohup npm start terminatednohup npm start 终止
【发布时间】:2020-09-09 08:37:04
【问题描述】:

我正在尝试使用此命令在后台运行我的 reactjs 项目。

nohup npm start > /dev/null 2>&1 &

输出应该被重定向,nohup 意味着当 stty 被切断时不终止进程。 但是我的 npm 节点根本没有运行。这是来自 nohup 日志。


Starting the development server...

events.js:291
      throw er; // Unhandled 'error' event
      ^

Error: EBADF: bad file descriptor, read
Emitted 'error' event on ReadStream instance at:
    at internal/fs/streams.js:202:14
    at FSReqCallback.wrapper [as oncomplete] (fs.js:528:5) {
  errno: -9,
  code: 'EBADF',
  syscall: 'read'
}

【问题讨论】:

    标签: node.js linux nohup


    【解决方案1】:

    您可以使用forever。您可以从链接中查看更高级的场景。下面是最简单的使用方法

    sudo npm install forever -g
    

    然后

    forever start app.js
    

    【讨论】:

    • 从'react'导入反应,{组件}; ^^^^^^ SyntaxError: cannot use import statement outside a module, when using forever
    猜你喜欢
    • 2021-01-20
    • 1970-01-01
    • 1970-01-01
    • 2021-05-21
    • 2019-12-24
    • 2018-12-23
    • 1970-01-01
    • 1970-01-01
    • 2018-09-18
    相关资源
    最近更新 更多