首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >dpkg-deb:错误:粘贴子进程被试图在Ubuntu22.04.2lts上安装特定版本的NodeJS的信号(断管)杀死

dpkg-deb:错误:粘贴子进程被试图在Ubuntu22.04.2lts上安装特定版本的NodeJS的信号(断管)杀死
EN

Ask Ubuntu用户
提问于 2023-05-29 04:47:37
回答 1查看 21关注 0票数 0

我试图在Ubuntu22.04.2LTS上安装NodeJS版本14,但是这个错误会弹出

dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)

这是完整的日志,如果有人需要的话:

代码语言:javascript
运行
复制
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gyp javascript-common libdevmapper1.02.1:i386 libefiboot1:i386
  libefivar1:i386 libjs-events libjs-highlight.js libjs-inherits
  libjs-is-typedarray libjs-psl libjs-source-map libjs-sprintf-js
  libjs-typedarray-to-buffer libnode-dev libnode72 libssl-dev libuv1-dev
  node-abbrev node-ansi-regex node-ansi-styles node-ansistyles
  node-are-we-there-yet node-arrify node-asap node-asynckit
  node-balanced-match node-brace-expansion node-chownr node-clean-yaml-object
  node-color-convert node-color-name node-commander node-core-util-is
  node-decompress-response node-delayed-stream node-delegates node-depd
  node-diff node-encoding node-end-of-stream node-err-code
  node-escape-string-regexp node-fancy-log node-foreground-child
  node-fs.realpath node-function-bind node-get-stream node-glob node-growl
  node-has-flag node-has-unicode node-hosted-git-info node-iconv-lite
  node-iferr node-imurmurhash node-indent-string node-inflight node-inherits
  node-ini node-ip node-ip-regex node-is-buffer node-is-plain-obj
  node-is-typedarray node-isarray node-isexe node-json-parse-better-errors
  node-jsonparse node-kind-of node-lodash-packages node-lowercase-keys
  node-lru-cache node-mimic-response node-minimatch node-minimist
  node-minipass node-mute-stream node-negotiator node-npm-bundled node-once
  node-osenv node-p-cancelable node-p-map node-path-is-absolute
  node-process-nextick-args node-promise-inflight node-promise-retry
  node-promzard node-pump node-quick-lru node-read node-readable-stream
  node-resolve node-retry node-safe-buffer node-set-blocking node-signal-exit
  node-slash node-slice-ansi node-source-map node-spdx-correct
  node-spdx-exceptions node-spdx-expression-parse node-spdx-license-ids
  node-sprintf-js node-stealthy-require node-string-decoder
  node-supports-color node-text-table node-time-stamp node-tmatch
  node-typedarray-to-buffer node-universalify node-util-deprecate
  node-validate-npm-package-license node-webidl-conversions node-whatwg-fetch
  node-wrappy node-yallist
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  nodejs
0 upgraded, 1 newly installed, 0 to remove and 114 not upgraded.
Need to get 0 B/25.4 MB of archives.
After this operation, 121 MB of additional disk space will be used.
(Reading database ... 255398 files and directories currently installed.)
Preparing to unpack .../nodejs_14.21.3-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (14.21.3-deb-1nodesource1) ...
dpkg: error processing archive /var/cache/apt/archives/nodejs_14.21.3-deb-1nodes
ource1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/node/common.gypi', which is also in package l
ibnode-dev 12.22.9~dfsg-1ubuntu3
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/nodejs_14.21.3-deb-1nodesource1_amd64.deb```
EN

回答 1

Ask Ubuntu用户

发布于 2023-05-29 09:00:03

溶液

在安装节点时,强烈建议使用nvm ()安装节点。这使得使用相关的npm从节点安装特定版本变得非常容易。它还使得节点版本之间的切换非常容易。

安装nvm

您可以在这里找到nvm:https://github.com/nvm-sh/nvm

运行:curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

这将在您的家中创建一个.nvm目录,并尝试更新您的.bashrc。

如果您不使用bash,请参阅文档,几乎所有的东西都支持。

具有nvm的

安装节点重新打开终端,以便使用nvm脚本。 安装节点版本: nvm install 14 选择节点版本: nvm use 14 如果要检查特定版本,请运行: nvm ls-remote

节点已安装

现在,您的节点版本已与其相关的npm版本一起安装。每个节点版本都有自己的node_modules。这意味着全局安装的npm包只适用于您安装的节点版本。

如果您想在节点版本之间切换,只需安装一个新版本,如nvm install lts,并使用nvm use lts进行切换。

如果您需要更多信息,请务必查看其github上的README.md。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1469841

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档