尝试安装“ apt-get install npm”时,显示错误

时间:2018-11-08 06:43:31

标签: npm apt-get

Err:3 http://in.archive.ubuntu.com/ubuntu cosmic/main amd64 linux-libc-dev amd64 4.18.0-10.11 Bad header line Bad header data [IP: 192.168.1.151 808] Get:4 http://in.archive.ubuntu.com/ubuntu cosmic/main amd64 libc6-dev amd64 2.28-0ubuntu1 [2,587 kB]

任何绕开这一障碍的解决方案将不胜感激。

1 个答案:

答案 0 :(得分:0)

如果将apt-get用于安装nodejs,则可以轻松切换版本:

$ sudo apt-get install npm # install npm
$ sudo npm install -g  n  # install n nodejs version switcher as global package.
$ sudo n stable # install latest stable version.
install more version: [exmp: 9.1.0]

$ sudo n 9.1.0