V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Livid
V2EX  ›  Node.js

在 CentOS 6 上大家通常是怎么安装 Node.js 呢?

  •  1
     
  •   Livid · 2012-12-05 20:18:08 +08:00 · 13027 次点击
    这是一个创建于 4153 天前的主题,其中的信息可能已经有所发展或是发生改变。
    26 条回复    2016-04-05 21:01:43 +08:00
    fevin86
        1
    fevin86  
       2012-12-05 20:39:16 +08:00
    下源码包./configure && make && make install
    gateswong
        2
    gateswong  
       2012-12-05 21:03:28 +08:00   ❤️ 1
    记得下源码包编译不成功
    我的方法是,直接下载预编译的包,然后copy到/usr/中
    anyforever
        3
    anyforever  
       2012-12-05 21:06:38 +08:00
    个人喜欢源码编译
    clowwindy
        4
    clowwindy  
       2012-12-05 21:06:44 +08:00
    v0.8 在 LANG=zh_CN.utf-8 的 CentOS 6 上编译不过,改成 en_US.utf-8 就好了。当时还给他们提过 issue。

    https://github.com/joyent/node/issues/3658
    11138
        5
    11138  
       2012-12-05 21:25:18 +08:00
    # cat /etc/system-release
    CentOS release 6.1 (Final)
    # locale
    LANG=en_US.UTF-8
    # wget http://nodejs.org/dist/v0.8.15/node-v0.8.15.tar.gz
    # tar zxvf node-v0.8.15.tar.gz
    # cd node-v0.8.15
    # ./configure --prefix=/usr
    # make
    # make install

    最新稳定版本是0.8.15,安装顺利。
    zythum
        6
    zythum  
       2012-12-05 21:41:41 +08:00
    记得被坑过。CentOS 在node0.8的版本的时候有蛮多bug的
    ericFork
        7
    ericFork  
       2012-12-05 22:13:42 +08:00   ❤️ 2
    曾经被这些事情烦得焦头烂额,狠下心花了两个月时间把所有机器全部切换到 Ubuntu,并使用 puppet 管理之后,整个世界都亮了……
    bitsmix
        8
    bitsmix  
       2012-12-05 22:19:28 +08:00
    珍爱声明,原理 redhat
    ispinfx
        9
    ispinfx  
       2012-12-05 22:33:31 +08:00
    ./configure && make && make install
    cheung
        10
    cheung  
       2012-12-05 22:37:51 +08:00
    要升级python
    roymax
        11
    roymax  
       2012-12-05 22:38:25 +08:00   ❤️ 1
    试试nvm或n吧,nodejs的版本管理。个人喜欢用nvm,因为安装n需要npm

    https://github.com/creationix/nvm

    https://github.com/visionmedia/n
    arzusyume
        12
    arzusyume  
       2012-12-06 08:50:30 +08:00   ❤️ 1
    centos6好像不用升python吧,自带的是2.6x
    默认编译就好了...
    5.x似乎还要升级python和gcc
    xieren58
        13
    xieren58  
       2012-12-06 09:20:24 +08:00
    推荐nvm,以后node版本更新灰常容易~~~
    jackyz
        14
    jackyz  
       2012-12-06 09:48:09 +08:00
    debian,build from source 前一阵子还是 0.6.x 有很多 native 依赖的 module 伤不起呀。
    Jeffrey4l
        15
    Jeffrey4l  
       2012-12-06 17:11:09 +08:00
    yum install -y gcc-c++ make git
    yum install -y openssl-devel
    git clone git://github.com/joyent/node.git
    cd node
    ./configure
    make
    make install
    pyKun
        16
    pyKun  
       2012-12-06 18:36:34 +08:00
    @Jeffrey4l welcome.......
    yegle
        17
    yegle  
       2012-12-07 04:34:34 +08:00
    必须让我在centos上搞,那就只好Gentoo prefix了
    Frannk
        18
    Frannk  
       2012-12-07 08:51:32 +08:00
    anyforever
        19
    anyforever  
       2012-12-07 10:13:45 +08:00
    安装个node.js还真愁人,越折腾,出来的问题越多。
    系统CentOS 5.7,源码编译安装,开始是编译不过去,升级了python到2.7
    编译安装完了,运行不了,在系统环境变量中添加了node的bin目录,再运行提示glibc版本不能低于2.6(nvm安装完,运行的时候,也会这样子的)
    汗了,这个是系统包,反正在测试的虚似机上,安装测试一下吧。安装前做下准备工作,发现编译这个的话,gcc版本好要到4.2以上。目前CentOS上是4.1.2也不知道行不行,官方已经发布到4.7.2了。好吧,认好,那就编译4.7.2的吧。
    测试去..........
    以上纯吐槽
    anyforever
        20
    anyforever  
       2012-12-07 11:16:41 +08:00
    借道问一下,CentOS 6下的rpm包,能在CentOS 5.x下升级用不?
    实在是不敢编译glibc啊,网上没见着有说编译成功了的,系统搞摊了的不少。万一坏掉了,测试机就没了,又得折腾。郁闷啊。
    clowwindy
        21
    clowwindy  
       2012-12-07 11:46:15 +08:00
    @anyforever 你试试 node 官网上 linux 的 binary 吧。
    BOYPT
        22
    BOYPT  
       2012-12-07 14:23:44 +08:00   ❤️ 1
    一群RHEL苦手。。

    看看我博客这篇能不能拯救下你们: http://apt-blog.net/rhel-centos-the-community-working-way

    其中Python可以使用FedoraHosted - SoftwareCollections仓库(安装在/opt的不会影响原系统的python,然后剩下的理论上rpm -i就好的了。

    「当然如果你只需要在一台机器安装,并且估计以后也不需要重复,源码编译是没什么问题的,即使要搞一大堆依赖」
    anyforever
        23
    anyforever  
       2012-12-07 18:32:17 +08:00
    @clowwindy 试了,0.8不行的,0.6版本的可以。
    mml
        24
    mml  
       2012-12-08 10:10:40 +08:00
    我就知道会是一堆“./configure && make && make install”
    jacy
        25
    jacy  
       2012-12-08 12:34:53 +08:00
    为什么这篇帖子的css不同,背景是灰的?
    Daddy
        26
    Daddy  
       2016-04-05 21:01:43 +08:00
    @bitsmix 六个中文字错了四个,何必勉强自己用拼音?!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   926 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 20:33 · PVG 04:33 · LAX 13:33 · JFK 16:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.