我有一个问题,更新我的服务器操作系统。以下是我在运行sudo yum update时遇到的错误列表:
file /usr/lib/node_modules/npm/node_modules/which/package.json from install of nodejs-2:8.17.0-1nodesource.x86_64 conflicts with file from package nodejs-which-1.0.5-8.el6.noarch
file /usr/lib/node_modules/npm/node_modules/which/bin/which from install of nodejs-2:8.17.0-1nodesource.x86_64 conflicts with file from package nodejs-which-1.0.5-8.el6.noarch
file /usr/lib/node_modules/npm/node_modules/which/which.js from install of nodejs-2:8.17.0-1nodesource.x86_64 conflicts with file from package nodejs-which-1.0.5-8.el6.noarch
file /usr/lib/node_modules/npm/node_modules/uid-number/package.json from install of nodejs-2:8.17.0-1nodesource.x86_64 conflicts with file from package nodejs-uid-number-0.0.3-7.el6.noarch
file /usr/lib/node_modules/npm/node_modules/uid-number/get-uid-gid.js from install of nodejs-2:8.17.0-1nodesource.x86_64 conflicts with file from package nodejs-uid-number-0.0.3-7.el6.noarch
file /usr/lib/node_modules/npm/node_modules/uid-number/uid-number.js from install of nodejs-2:8.17.0-1nodesource.x86_64 conflicts with file from package nodejs-uid-number-0.0.3-7.el6.noarch
file /usr/lib/node_modules/npm/node_modules/osenv/package.json from install of nodejs-2:8.17.0-1nodesource.x86_64 conflicts with file from package nodejs-osenv-0.0.3-5.el6.noarch
file /usr/lib/node_modules/npm/node_modules/osenv/osenv.js from install of nodejs-2:8.17.0-1nodesource.x86_64 conflicts with file from package nodejs-osenv-0.0.3-5.el6.noarch
file /usr/lib/node_modules/npm/bin/npm from install of nodejs-2:8.17.0-1nodesource.x86_64 conflicts with file from package npm-1.3.6-5.el6.noarch
file /usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp from install of nodejs-2:8.17.0-1nodesource.x86_64 conflicts with file from package npm-1.3.6-5.el6.noarch
file /usr/lib/node_modules/npm/node_modules/node-gyp from install of nodejs-发布于 2020-06-09 09:43:41
从部分列表中可以看出,您已经安装了一个版本的nodejs (8.17.0和nodesource在发布字符串中),它与系统存储库提供的版本(在发布字符串中有el6 )发生冲突。现在,当您更新时,有些系统残留物正在尝试更新,或者系统存储库提供了一个更新,以满足更新您已安装的包的版本要求,但由于打包方式或系统包的依赖关系不同,存在冲突。
告诉yum跳过更新npm可能就足够了(因为这至少是您所显示的输出列表中的一个明显冲突,并且可能是导致其他冲突更新的原因)。
sudo yum update --exclude=npm如果只想保留较新的nodejs版本,则应该查找来自系统存储库的nodejs/npm包的所有跟踪(它们很可能在包发布字符串中包含el6 )和yum remove,因此更新后的版本是唯一剩下的版本。但是,在执行此操作时,您可能会发现其他需要旧版本的包,不应在不考虑对系统的潜在影响的情况下强制执行此操作。
https://unix.stackexchange.com/questions/591688
复制相似问题