如何安装node-waf?
首先,支持 Node.js 的开发者。我使用它还不到一天,我已经在考虑将它用于我现在使用 Python 的东西了。
事实上,无论谁开发了 Node.js,都应该考虑将它用于他们现在使用 Python 的东西。显然,Python 中有一个名为 node-waf 的工具,它是 npm 工作所必需的,当然 npm 对于其他有用的东西也是必需的。
我认为我原来的安装失败了,因为node-waf(位于 /mnt/michael/bin/node-waf
中)找不到 Scripting.py(位于 /mnt 中) /michael/node/tools/wafadmin/
; 它正在寻找不存在的 /mnt/michael/node/tools/../lib/node/wafadmin/
)。所以我破解了node-waf以指向正确的导演并继续前进,发现了一个更严重的问题。
事实证明,node-waf 不是用“Python”编写的,而是用 Python2.6 编写的,Python2.6 是一种非常好的语言,它是我自己使用的语言,但它不是我使用的系统上的默认值。系统为CentOS,要求Python2.4为命令“python”调用的Python。是的,这对 CentOS 人员来说是愚蠢的,但比 Node-WAF 人员犯的同样错误要愚蠢得多,因为他们必须遵守操作系统的规则。
所以,请告诉我有一些我还没有找到的开关说“使用Python2.6”。此外,任何有关正确安装的提示将不胜感激。
First, props to whoever did node.js. I've been using it for less than a day and I'm already thinking about using it for stuff I use Python for now.
In fact, whoever did node.js should think about using it for stuff they use Python for now. There is apparently a tool called node-waf that is in Python and is necessary for npm to work and npm of course is necessary for anything else useful.
I think that my original install went bad because node-waf (which is in /mnt/michael/bin/node-waf
) couldn't find Scripting.py (which is in /mnt/michael/node/tools/wafadmin/
; it was looking in non-existent /mnt/michael/node/tools/../lib/node/wafadmin/
). So I hacked node-waf to point to the right director and kept going and found a much more serious problem.
Turns out node-waf isn't written in "Python", but in Python2.6, which is a perfectly good language, it's the language I use myself, but it isn't the language that the default on the system I use. The system is CentOS, which requires Python2.4 be the Python that the command "python" invokes. Yes, that's foolish on the part of the CentOS people but less foolish than the same mistake on the part of the node-waf people, since they are necessarily subject to the rules of the OS.
So, please tell me there's some switch I haven't found yet that say "Use Python2.6". Also, any hints about a proper install would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了解决路径问题,我备份并重新安装了Node。为了解决版本问题,根据 #nodejs 频道上一些聪明人的建议,我在 ~/bin/python 中创建了一个指向正确版本的符号链接(这也解决了我自己的很多问题,启动来自命令行的错误版本...)这是一个明显的黑客行为,但是当您感到沮丧时,您会忽略显而易见的事情。
To solve the path problem, I backed up and re-installed Node. To solve the version problem, at the suggestion of some bright soul on the #nodejs channel, I created a symbolic link at ~/bin/python that pointed to the right version (that solved a lot of my own problems too, starting up the wrong version from the command line...) An obvious hack, but when you're frustrated, you overlook the obvious.