Nodejs :取決於:rlwrap 但無法安裝

Nodejs :取決於:rlwrap 但無法安裝

剛剛在雲端購買了一個新的虛擬伺服器,Ubuntu 14.04。

我使用 apt-get update 更新了我的軟體包。

嘗試安裝 Node.js 時遇到問題。我遵循了這個指南:https://github.com/joyent/node/wiki/installing-node.js-via-package-manager

當我跑步時sudo apt-get install -y nodejs我得到這個:

user@server sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 nodejs : Depends: rlwrap but it is not installable
E: Unable to correct problems, you have held broken packages.

這個rlwrap是什麼?我用谷歌搜尋但沒有找到如何安裝它。

--更新--

我嘗試了下面的建議。沒有成功。我降級到12.04。那裡一切正常。

答案1

我在 Ubuntu 14.04 中遇到了同樣的問題。解決方案:

  1. 下載rlwraphttp://packages.ubuntu.com/trusty/rlwrap。這裡有一個直接連結
  2. 安裝它sudo dpkg -i rlwrap_0.34-2_amd64.deb
  3. 安裝nodejssudo apt-get install nodejs

答案2

  1. 啟用 Universe 儲存庫sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
  2. 修復和更新sudo dpkg --configure -a && sudo apt-get update && sudo apt-get -y upgrade
  3. 再試一次(請注意,node.js 指令將 Ubuntu 儲存庫替換為自訂儲存庫,因此請確保腳本有效)
>apt-cache show rlwrap
Package: rlwrap
Priority: optional
Section: universe/editors
Installed-Size: 300
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Francois Marier <[email protected]>
Architecture: amd64
Version: 0.37-2
Provides: readline-editor
Depends: libc6 (>= 2.4), libncurses5 (>= 5.7+20100313), libreadline6 (>= 6.0)
Filename: pool/universe/r/rlwrap/rlwrap_0.37-2_amd64.deb
Size: 80968
MD5sum: 8fca381b84e7205b92615d2d2f6df588
SHA1: ea227d0b53c16cec64f259e349d69073fce972f8
SHA256: 09d5d948a387f77a1f09b8ad800a73349dbcd6245f787496e0f1743df5259ea4
Description-en: readline feature command line wrapper
 This package provides a small utility that uses the GNU readline library
 to allow the editing of keyboard input for any other command.  Input
 history is remembered across invocations, separately for each command;
 history completion and search work as in bash and completion word lists
 can be specified on the command line.
Homepage: http://utopia.knoware.nl/~hlub/uck/rlwrap/
Description-md5: 2dd4e4df63ed824e61c4e21ad05cd1eb
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Task: edubuntu-desktop-kde, edubuntu-desktop-gnome

答案3

這是我在 Ubuntu 14.04 上安裝 Node.js 的方法,並解釋了為什麼我喜歡以這種方式安裝 Node。
它涉及添加第三方 PPA - 它已經被很多人使用過,並且似乎是 Ubuntu 上最受歡迎的 Node PPA,運行:

sudo apt-get install python-software-properties

+

sudo apt-add-repository ppa:chris-lea/node.js

+

sudo apt-get update

+

sudo apt-get install nodejs

檢查安裝狀況

node -v

背景

看來nodejs與Debian和Ubuntu使用的另一個也稱為「node」的軟體包有衝突

例如,如果您使用以下命令搜尋 Ubuntu 儲存庫:

apt-cache search node | grep Amateur

你會看到一個名為

節點 - 業餘分組無線電節點計畫(過渡包)

它是一個舊的業餘無線電包,Debian/Ubuntu 在兩個 Ubuntu 儲存庫中都優先於 Nodejs作為命令列參數。我可能是錯的,但我相信 Debain/Ubuntu 可能已經修改了他們的節點版本以使用正常命令所在的
命令,以防止兩個套件之間發生衝突。 我從來不打算安裝業餘無線電版本,所以我選擇安裝一個非官方版本,我知道它確實響應命令,因為我懷疑如果其他nodejs相關程序嘗試使損壞的可能性會更高撥打電話但未得到回复。nodejsnode
nodenode

答案4

誰嘗試在ubuntu vim(ubuntu bq平板電腦)上安裝node:遵循@bekce的解決方案,只是你需要注意你的機器的架構。我的平板電腦是armhf,所以我從以下rlwrap位置下載armhf

wget https://launchpad.net/ubuntu/+source/rlwrap/0.41-1

其餘部分相同:

sudo dpkg -i rlwrap_0.34-2_amd64.deb
sudo apt-get install nodejs

相關內容