我正在尝试使用“永远”的 node.js 包在 Ubuntu 上运行 node.js 服务。看起来应该很简单。但是,当我运行它时,我收到以下输出:
/usr/bin/env: node: No such file or directory
我认为这可能是因为 Ubuntu 包管理器将 node.js 二进制文件命名为 nodejs
,而不是更标准的 node
。有没有办法告诉 forever 包在哪里可以找到 Node ?
(我确实尝试过将 /usr/bin/node
符号链接(symbolic link)到 /usr/bin/nodejs
,但这产生了更多的错误,而且感觉就像是 hack)
最佳答案
你试过了吗installing the latest node from source ?
git clone https://github.com/joyent/node.git
cd node
git checkout v0.8.22 #Try checking nodejs.org for what the stable version is
./configure
make
sudo make install
This video尚不完全清楚,但作者暗示 Debian 存储库中的旧版本 Node 是 Node/nodejs 命名问题的幕后黑手。
或者,您可以尝试使用描述的任何方法找到/usr/bin/nodejs 符号链接(symbolic link)的目标 here并为此创建一个/usr/bin/node 符号链接(symbolic link)。
祝你好运!
关于node.js - 使用 forever 在 Ubuntu 上运行 node.js 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15043286/