node.js - 升级到 Nodejs 8 和 "error: failed to commit transaction"

标签 node.js linux archlinux

我正在尝试在我的 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.

现在我想我的 nodejs 坏了!

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

有什么想法我现在应该做什么吗?

最佳答案

我遇到了同样的问题,我是这样解决的:

sudo pacman -S nodejs npm --force

即使您收到现有文件的警告,选项 --force 也会升级您的包。

之后你需要用 pacman 安装 http-parser :

sudo pacman -S http-parser --force

最后,node -v 会给你这个错误:

error while loading shared libraries: libicui18n.so.59: cannot open shared object file: No such file or directory

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

sudo pacman -S icu --force

开始吧,您的 Node 版本现在是 v8.4.0。

17/01 编辑: --force 已弃用。请使用 --overwrite

关于node.js - 升级到 Nodejs 8 和 "error: failed to commit transaction",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45000674/

相关文章:

node.js - Winston 日志配置不当

javascript - Node process.env 变量为空

linux - Hadoop 守护进程无法停止使用正确的命令

node.js - 带有命名参数的 `WHERE col IN`

javascript - 如何有选择地将中间件(multer)插入到新的 Express 路由器中

c++ - 异步的令人费解的行为

java - 阅读使用java发送的电子邮件

linux - 如何在 Makefile 中找到基础架构?

php - 从 PHP 运行 Python 脚本

ruby - 在 Manjaro Deepin 中安装 Vagrant 插件时出错