V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
GrahamACER
V2EX  ›  程序员

Linux 下 node-gyp 编译,总是默认使用旧版本 gcc 的问题

  •  
  •   GrahamACER · 2018-08-08 10:49:34 +08:00 · 2980 次点击
    这是一个创建于 2078 天前的主题,其中的信息可能已经有所发展或是发生改变。

    已经在 linux 下下载编译更新了 4.9.1 的 gcc,gcc -v 也显示 4.9.1 版本

    sudo update-alternatives --config gcc 也显示唯一新安装的 4.9.1 的 gcc (新配的)

    目前的问题是,npm install 的话发现 node-gyp 报错,主要内容为

    错误:#error This version of node/NAN/v8 requires a C++11 compiler /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/shared_ptr.h:146: 错误:在指定 -fno-rtti 的情况下不能使用 typeid ...

    依然使用旧版 gcc 4.4.7 默认编译,是不是 npm 有什么位置需要重新配置?

    tempdban
        1
    tempdban  
       2018-08-08 15:05:02 +08:00 via Android   ❤️ 1
    update-alternatives 不是 Ubuntu 系的命令嘛

    x86_64-redhat-linux 这是啥意思
    GrahamACER
        2
    GrahamACER  
    OP
       2018-08-08 17:48:29 +08:00
    @tempdban CentOS6 自带这个版本 GCC,安装路径就是 x86_64-redhat-linux
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   951 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 21:42 · PVG 05:42 · LAX 14:42 · JFK 17:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.