来自Git的NodeJs安装问题

时间:2012-02-02 09:22:57

标签: node.js installation

我安装了Node版本0.4.11(它是很久以前安装的,我甚至不记得我最初是如何安装它的。)

但是我尝试安装最新版本,所以我可以再次开始使用Node,并发现尽管从{}发送node -v时我的Git安装似乎成功了但我仍然得到{ {1}}?

我可以安装在现有Node安装的顶部,如果不能安装Node,那么我可以尝试按照Wiki页面https://github.com/joyent/node/wiki/Installation演示的那样从Git存储库运行UNIX样式安装。

我尝试使用https://github.com/joyent/node/wiki/Installation运行其命令v0.4.11来安装最新版本的Node,但是虽然我得到了n 0.6.7但是无法成功删除一些源文件(不是确定这是否是一个问题)...

'install' finished successfully (56.705s)

然后,当我运行... removing source cp: /usr/local/include/node/ares.h: Permission denied cp: /usr/local/include/node/ares_version.h: Permission denied cp: /usr/local/include/node/c-ares/ares.h: Permission denied cp: /usr/local/include/node/c-ares/ares_version.h: Permission denied cp: /usr/local/include/node/config.h: Permission denied cp: /usr/local/include/node/node.h: Permission denied cp: /usr/local/include/node/node_buffer.h: Permission denied cp: /usr/local/include/node/node_config.h: Permission denied cp: /usr/local/include/node/node_object_wrap.h: Permission denied cp: /usr/local/include/node/node_version.h: Permission denied cp: /usr/local/include/node/uv-private/eio.h: Permission denied cp: /usr/local/include/node/uv-private/ev.h: Permission denied cp: /usr/local/include/node/uv-private/ngx-queue.h: Permission denied cp: /usr/local/include/node/uv-private/tree.h: Permission denied cp: /usr/local/include/node/uv-private/uv-unix.h: Permission denied cp: /usr/local/include/node/uv-private/uv-win.h: Permission denied cp: /usr/local/include/node/uv.h: Permission denied cp: /usr/local/include/node/v8-debug.h: Permission denied cp: /usr/local/include/node/v8-preparser.h: Permission denied cp: /usr/local/include/node/v8-profiler.h: Permission denied cp: /usr/local/include/node/v8-testing.h: Permission denied cp: /usr/local/include/node/v8.h: Permission denied cp: /usr/local/include/node/v8stdint.h: Permission denied 时,我仍然得到node -v

感谢您给我的任何帮助,因为我很困惑?

我已经在Node的问题跟踪器上设置了一个问题,万一有人可以提出建议:https://github.com/visionmedia/n

2 个答案:

答案 0 :(得分:0)

您到节点箱的路径不正确。你可以通过

来检查这个
which node

输出将是pathto节点

然后执行以下操作 - 在PATH env varaiable中添加新节点安装的路径

export PATH="$PATH:/path/to/new/node" (add it to you bashrc)

也做,

export NODE_PATH="/path/to/new/node"

答案 1 :(得分:0)

我现在实际上是在Twitter上的某个人的帮助下解决了这个问题。

我们必须删除Node安装,然后使用自制程序重新安装它,因为我的原始Node安装似乎存在权限问题,导致无法轻松删除它。

我会将此回复标记为正确答案,因为我无法检查之前的回复以确认 * * 是否有效。