我试图在Ubuntu14.04上安装npm。上面写着
npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.我在互联网上尝试了所有的解决方案,比如
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get install -f
apt-get clean
apt-get autoclean
apt-get autoremove
dpkg --configure -a但我还是会犯同样的错误。
当我尝试sudo aptitude install npm时,上面写着
The following NEW packages will be installed:
build-essential{a} g++{a} g++-4.8{a} gyp{a} javascript-common{a} libc-ares-dev{a} libc-ares2{a} libc-dev-bin{ab} libc6-dev{ab} libjs-node-uuid{a} libssl-dev{a}
libstdc++-4.8-dev{a} libv8-3.14-dev{a} libv8-3.14.5{a} node-abbrev{a} node-ansi{a} node-archy{a} node-async{a} node-block-stream{a} node-combined-stream{a}
node-cookie-jar{a} node-delayed-stream{a} node-forever-agent{a} node-form-data{a} node-fstream{a} node-fstream-ignore{a} node-github-url-from-git{a} node-glob{a}
node-graceful-fs{a} node-gyp{a} node-inherits{a} node-ini{a} node-json-stringify-safe{a} node-lockfile{a} node-lru-cache{a} node-mime{a} node-minimatch{a}
node-mkdirp{a} node-mute-stream{a} node-node-uuid{a} node-nopt{a} node-normalize-package-data{a} node-npmlog{a} node-once{a} node-osenv{a} node-qs{a}
node-read{a} node-read-package-json{a} node-request{a} node-retry{a} node-rimraf{a} node-semver{a} node-sha{a} node-sigmund{a} node-slide{a} node-tar{a}
node-tunnel-agent{a} node-which{a} nodejs{a} nodejs-dev{a} npm zlib1g-dev{a}
0 packages upgraded, 62 newly installed, 0 to remove and 10 not upgraded.
Need to get 25.7 MB of archives. After unpacking 73.8 MB will be used.
The following packages have unmet dependencies:
libc-dev-bin : Depends: libc6 (< 2.20) but 2.24-17 is installed.
libc6-dev : Depends: libc6 (= 2.19-0ubuntu6.13) but 2.24-17 is installed.
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) build-essential [Not Installed]
2) g++ [Not Installed]
3) g++-4.8 [Not Installed]
4) libc-dev-bin [Not Installed]
5) libc6-dev [Not Installed]
6) libssl-dev [Not Installed]
7) libstdc++-4.8-dev [Not Installed]
8) node-gyp [Not Installed]
9) nodejs-dev [Not Installed]
10) npm [Not Installed]
11) zlib1g-dev [Not Installed]
Leave the following dependencies unresolved:
12) node-gyp recommends build-essential
Accept this solution? [Y/n/q/?`<br/>我不明白到底是什么问题。我还试着查看synaptic管理器,在坏包部分没有任何报告。
敬请指教。
发布于 2017-11-19 14:40:18
您要安装的NPM包来自于Ubuntu可靠的(14.04)存档,并且需要一个比2.20版本更老的libc6版本。可靠档案中的libc6版本是2.19版本,符合要求。
但是,您的系统有2.24-17版本的libc6,该库的源是一个.deb文件,您可能下载并安装了该文件,因为您想要运行的东西需要更新版本的libc6。这显然是来自Debian包: Ubuntu档案中没有这样的库。您可以将http://archive.ubuntu.com/ubuntu/pool/main/g/glibc/从2.24-9引用到2.26-0,而不需要这个库。
所以..。
你有两种选择,这两种选择都不容易:
考虑到这个问题的时间框架,安装npm对你来说似乎并不重要。我的建议是,如果可能,在系统中创建一个虚拟机。然后,您可以在该机器上安装linux版本,并使用该版本加载和运行npm。
作为以后的参考,尽管可以加载和安装用于其他发行版的.deb包,但并不总是可取的。这些包可能具有与Ubuntu中提供的包和库冲突的依赖项和库。
https://askubuntu.com/questions/977063
复制相似问题