NPM does not install anything : it hangs

2019-04-18 18:29发布

Whenever I want to install a module with NPM, it hangs at that stage:

npm install express
npm http GET https://registry.npmjs.org/express

And that's it. It has that behavior for anything I input instead of express. I installed nodejs and nvm that way (Ubuntu 13.10):

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

I tried looking on the Internet and GitHub and I found a closed issue about npm hanging forever when trying to install a module.. but it was a really old issue. Before I ask the developers, am I missing something obvious ?

I tried compiling both nodejs and npm but the result was the same.

EDIT: npm install express -verbose -> http://pastebin.com/tGY3V6Ly Error:

npm info retry will retry, error on last attempt: Error: tunneling socket could not be established, cause=140072708810560:error:140770FC:SSL   routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:766:

标签: node.js npm
9条回答
孤傲高冷的网名
2楼-- · 2019-04-18 18:35

I had this issue on a BeagleBone Black (low power ARM device) and running npm cache clean seemed to get things moving again.

查看更多
再贱就再见
3楼-- · 2019-04-18 18:37

I was using an older version of node. I used a newer version Type in Terminal:

nvm use stable

and then

npm i

and all worked just fine.

查看更多
虎瘦雄心在
4楼-- · 2019-04-18 18:41

NPM has been having server issues of late. Try running the command with -verbose to check and see what is going on, and be patient.

查看更多
甜甜的少女心
5楼-- · 2019-04-18 18:48

I had the same issue and I solved by disabling all my firewalls

查看更多
时光不老,我们不散
6楼-- · 2019-04-18 18:48

I opened console with admin privileges and the ran npm install on windows. My problem was fixed with this

查看更多
小情绪 Triste *
7楼-- · 2019-04-18 18:51

I had the same error and the problem was in proxy: previously I set up HTTP_PROXY environment variable and after removing it npm install completed without any error.

查看更多
登录 后发表回答