代码之家  ›  专栏  ›  技术社区  ›  Run

升级到Nodejs 8和“错误:提交事务失败”

  •  4
  • Run  · 技术社区  · 7 年前

    我正在尝试在我的arch linux中将我的nodejs 6升级到8。所以我做到了:

    $ sudo pacman -S nodejs npm
    

    resolving dependencies...
    looking for conflicting packages...
    
    Packages (3) openssl-1.0-1.0.2.l-1  nodejs-8.1.3-1  npm-4.6.1-1
    
    Total Installed Size:  39.22 MiB
    Net Upgrade Size:       6.79 MiB
    
    :: Proceed with installation? [Y/n] y
    (3/3) checking keys in keyring                                                                                    [####################################################################] 100%
    (3/3) checking package integrity                                                                                  [####################################################################] 100%
    (3/3) loading package files                                                                                       [####################################################################] 100%
    (3/3) checking for file conflicts                                                                                 [####################################################################] 100%
    error: failed to commit transaction (conflicting files)
    openssl-1.0: /usr/lib/libcrypto.so.1.0.0 exists in filesystem
    openssl-1.0: /usr/lib/libssl.so.1.0.0 exists in filesystem
    Errors occurred, no packages were upgraded.
    

    现在我的头坏了,我想!

    $ node --version
    node: error while loading shared libraries: libhttp_parser.so.2.7.1: cannot open shared object file: No such file or directory
    

    你知道我现在该怎么办吗?

    1 回复  |  直到 7 年前
        1
  •  3
  •   JStw Trung Phạm    5 年前

    我也有同样的问题,我就是这样解决的:

    sudo pacman -S nodejs npm --force
    

    在此之后,您需要使用pacman安装http解析器,以便:

    sudo pacman -S http-parser --force
    

    加载共享库时出错:libicui18n.so。59:无法打开共享对象文件:没有此类文件或目录

    要修复它,请从pacman安装icu lib:

    sudo pacman -S icu --force
    

    现在,您的节点版本是v8.4.0。

    2001年17月编辑: