我想將我的nodejs和npm 1.4升級到最新版本。我設法將我的nodejs升級到10.0.40,但我的npm無法更新。所以我決定一起刪除它並重新安裝最新版本。現在,我不僅可以安裝最新版本,但我不能安裝我以前的一個。每次我嘗試安裝它給我這個錯誤:無法在Ubuntu上安裝npm 12.04
$ sudo apt-get install npm
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:
npm : Depends: nodejs but it is not going to be installed
Depends: nodejs-dev
Depends: node-request but it is not going to be installed
Depends: node-mkdirp but it is not going to be installed
Depends: node-minimatch but it is not going to be installed
Depends: node-semver but it is not going to be installed
Depends: node-ini but it is not going to be installed
Depends: node-graceful-fs but it is not going to be installed
Depends: node-abbrev but it is not going to be installed
Depends: node-nopt but it is not going to be installed
Depends: node-fstream but it is not going to be installed
Depends: node-rimraf but it is not going to be installed
Depends: node-tar but it is not going to be installed
Depends: node-which but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我怎麼能安裝最新版本,當我根本沒有它?
「我設法升級我的nodejs」是什麼意思?你究竟做了什麼?這可能是相關的信息... –
意味着我在我的電腦上降級了我的節點 – user2938948
這沒有什麼幫助。您正在尋求幫助,並應盡力提供所有相關信息。你升級的步驟是什麼?你是否從源代碼安裝?你升級了debian'nodejs'包嗎?你從另一個ppa安裝了嗎? –