Cisum Inas
Cisum Inas

Reputation: 13010

Npm install just spinning on Ubuntu

I can't successfully install anything with npm now it seems on my Ubuntu 15.04.

npm install -g gulp
/

Just spinns for ever and nothing happens, tried with sudo and without..

nodejs -v
v0.12.4

and

npm -v 
2.10.1

I have tried

*Reinstall nodejs

*Clearing the cahce globally and locally.

*Removing nodejs manually

*Tried installing different npm packages (Gulp, browserfiy ..etc)

*Chainging the ownership of ~/.npm recursivly to me instead of root

But nothing gives, I feel the only thing left for me to do is reinstall ubuntu..

Do you have any suggestions? All help is appreciated!

Upvotes: 0

Views: 980

Answers (2)

shan1024
shan1024

Reputation: 1399

This seems like a problem with your internet connection. Two possible reasons that I can think of are,

1) Connecting to the internet through a proxy server.

Then you will have to configure proxy for the npm. You can do this by adding HTTP_PROXY, HTTPS_PROXY environment variables to a value like http://proxy.company.com:8080 or when you are installing modules using this command.

npm --https-proxy=http://proxy.company.com:8080 -g install gulp

2) You don't use a proxy, but proxy setting are enabled in your computer.

If you don't use a proxy but if you have set up HTTP_PROXY, HTTPS_PROXY environment variables, npm will not be able to download the module because it automatically uses these settings. So remove those environment variables and try again.

If you use -d flag, you can see the details of the download.

npm install -g -d gulp

Hope this is helpful.

References: Using Npm Behind a Corporate Proxy

Upvotes: 1

Chandler
Chandler

Reputation: 63

My suggestion is to develop everything using ubuntu 14.04. A lot of virtual server providers only let you use 14.04 if you choose ubuntu (such as Digitalocean). Also a lot of service providers (such as Docker and many others) use ubuntu 14.04 as their standard base ubuntu image for you to develop your services. And it will be much easier for you to code, test, ship in the same environment just like others do.

Upvotes: 0

Related Questions