使用npm安装hexo,提示:

npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian

找了半天无解,最后发现其实只要一句话就能搞定:

sudo apt-get install nodejs-legacy

原因如下:

First of all let me clarify the situation a bit. In summer 2012 Debian maintainers decided to rename Node.js executable to prevent some kind of namespace collision with another package. It was very hard decision for Debian Technical Committee, because it breaks backward compatibility.

百度翻译一下就是:

首先让我澄清一下情况。2012夏季Debian维护人员决定重命名执行防止某种命名空间的冲突与另一包Node.js。这是个技术委员会非常艰难的决定,因为它打破向后兼容性。

所以为了向后兼容,就需要自己安装原来老的版本nodejs-legacy