【问题标题】:Which node forever.js is callling?哪个节点 forever.js 正在调用?
【发布时间】:2016-07-15 18:13:48
【问题描述】:

我在我的服务器中使用 forever.js。当我运行forever start index.js 时,它运行良好,但是当我调用node index.js 时,它说:

The program 'nodejs' is currently not installed. You can install it by typing:
apt-get install nodejs

我尝试运行which node,也显示了上述消息。我很困惑。我的服务器中是否安装了 node.js?

【问题讨论】:

    标签: node.js ubuntu-14.04 forever


    【解决方案1】:

    在 Ubuntu 上,node 包是指一些与 node.js 无关的程序。 因此,使用了包nodejs,并且似乎永远在寻找它。

    您应该在选项中搜索如何将正确的可执行文件指向永久。

    快速查看documentation 似乎暗示您应该致电:

    forever start index.js -c node
    

    或者如果不被识别

    forever start index.js -c /path/to/node 
    

    【讨论】:

    • 问题是我不知道nodejs有没有安装,因为foreverjs运行正常,但是调用的时候控制台说nodejs没有安装
    • @OscarYuandinata:which nodewhich nodejs的结果是什么,启动后永远打印什么?
    • 虽然我已经卸载了 nodejs,但看起来也安装了 nvm。不知何故,foreverjs 在 nvm 文件夹中调用 nodejs,同时运行 which 会导致上面的消息。现在问题已经解决了。无论如何谢谢:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-30
    • 2022-11-28
    • 2013-11-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多