我想将我的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安装了吗? –