2016-12-23 146 views
-1

我试过这个命令:如何在Ubuntu 16.04上安装npm 3.10.8?

npm install [email protected] 

,我得到这个错误:

npm ERR! Linux 4.4.0-21-generic

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "[email protected]"

npm ERR! node v4.2.6

npm ERR! npm v3.5.2

npm ERR! code ECONNRESET

npm ERR! network tunneling socket could not be established, cause=socket hang up

npm ERR! network This is most likely not a problem with npm itself

npm ERR! network and is related to network connectivity.

npm ERR! network In most cases you are behind a proxy or have bad network settings.

npm ERR! network

npm ERR! network If you are behind a proxy, please make sure that the

npm ERR! network 'proxy' config is set properly. See: 'npm help config'

npm ERR! Please include the following file with any support request:

npm ERR! /home/user/npm-debug.log

+0

正如所述,请添加以下任何支持请求的文件: /home/user/npm-debug.log,请将其添加到http://pastebin.com/index.php。不要粘贴在这里。 – GeekAb

回答

-1

,我使用的一个是从的NodeJS可以

$ sudo apt-get install python-software-properties 
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - 
$ sudo apt-get install nodejs 
$ node -v 
$ npm -v 

有运行下面的代码你去吧,你应该开始运行!请转至Installing NodeJs

+0

我只是想知道如何解决这个问题? – GeekAb