在Ubuntu上运行node.js服务器永远使用

前端之家收集整理的这篇文章主要介绍了在Ubuntu上运行node.js服务器永远使用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试使用’forever’node.js包在Ubuntu上运行node.js服务.似乎它应该是直截了当的.但是,当我运行它时,我收到以下输出
/usr/bin/env: node: No such file or directory

我想这可能是因为Ubuntu包管理器命名node.js二进制nodejs而不是node,这是更标准的.有没有办法告诉永远的包在哪里找到节点?

(我确实尝试将/usr/bin/node符号链接到/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 / nodejs命名问题的后面.

或者,您可以尝试使用here中描述的任何方法查找/usr/bin/nodejs符号链接的目标,并为其创建/usr/bin/node符号链接.

祝好运!

猜你在找的Ubuntu相关文章