This repository has been archived by the owner. It is now read-only.

sudo curl http://npmjs.org/install.sh | sh #1641

Closed
alexhuang91 opened this Issue Nov 2, 2011 · 21 comments

Comments

Projects
None yet
@alexhuang91

alexhuang91 commented Nov 2, 2011

All clean!
npm ERR! Could not create /usr/lib/node_modules/___npm.npm
npm ERR! error installing npm@1.0.103 Error: EACCES, Permission denied '/usr/lib/node_modules'
npm ERR! Error: EACCES, Permission denied '/usr/lib/node_modules'
npm ERR! Report this entire log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com
npm ERR!
npm ERR! System Linux 3.0.0-12-generic
npm ERR! command "/usr/bin/node" "/tmp/npm.29786/package/cli.js" "install" "-gf"
npm ERR! cwd /tmp/npm.29786/package
npm ERR! node -v v0.4.12
npm ERR! npm -v 1.0.103
npm ERR! path /usr/lib/node_modules
npm ERR! code EACCES
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/npm.29786/package/npm-debug.log
npm not ok
It failed

@bobrik

This comment has been minimized.

Show comment
Hide comment
@bobrik

bobrik Nov 2, 2011

Contributor

curl http://npmjs.org/install.sh | sudo sh

Contributor

bobrik commented Nov 2, 2011

curl http://npmjs.org/install.sh | sudo sh

@devansh

This comment has been minimized.

Show comment
Hide comment
@devansh

devansh Nov 2, 2011

Hi, I am a newbie to node.js and have installing npm for the first time and having some trouble using the one line install.

when i use the :

curl http://npmjs.org/install.sh | sudo sh

I get nothing. (I mean the file is downloaded but then the prompt returns and npm is not installed)

and when i use:

curl http://npmjs.org/install.sh | sh    # without sudo

I get the error :

failed to get tarball url for npm/latest

Please advise .TIA

I don't know whether this is the right post to bring this up or not because there was another similar post but that was closed issue and I did not have permission to reopen it. If I am wrong please redirect me to the correct post.

devansh commented Nov 2, 2011

Hi, I am a newbie to node.js and have installing npm for the first time and having some trouble using the one line install.

when i use the :

curl http://npmjs.org/install.sh | sudo sh

I get nothing. (I mean the file is downloaded but then the prompt returns and npm is not installed)

and when i use:

curl http://npmjs.org/install.sh | sh    # without sudo

I get the error :

failed to get tarball url for npm/latest

Please advise .TIA

I don't know whether this is the right post to bring this up or not because there was another similar post but that was closed issue and I did not have permission to reopen it. If I am wrong please redirect me to the correct post.

@bobrik

This comment has been minimized.

Show comment
Hide comment
@bobrik

bobrik Nov 2, 2011

Contributor

what about

sudo su
curl http://npmjs.org/install.sh | sh
Contributor

bobrik commented Nov 2, 2011

what about

sudo su
curl http://npmjs.org/install.sh | sh
@thejh

This comment has been minimized.

Show comment
Hide comment
@thejh

thejh Nov 2, 2011

Contributor

Try this:

npm_debug=1 curl http://npmjs.org/install.sh | sudo sh
Contributor

thejh commented Nov 2, 2011

Try this:

npm_debug=1 curl http://npmjs.org/install.sh | sudo sh
@isaacs

This comment has been minimized.

Show comment
Hide comment
@isaacs

isaacs Nov 2, 2011

Member

@thejh The npm_debug=1 needs to be on the sh, as well, and requires a bash/zsh capable interpreter.

curl http://npmjs.org/install.sh | sudo npm_debug=1 bash

@devansh What operating system are you seeing this no-output behavior on? A few people have reported similar results, and I can't seem to track it down. It always seems to work using bash in debug mode, so I'm guessing it's some kind of sh-related thing.

Member

isaacs commented Nov 2, 2011

@thejh The npm_debug=1 needs to be on the sh, as well, and requires a bash/zsh capable interpreter.

curl http://npmjs.org/install.sh | sudo npm_debug=1 bash

@devansh What operating system are you seeing this no-output behavior on? A few people have reported similar results, and I can't seem to track it down. It always seems to work using bash in debug mode, so I'm guessing it's some kind of sh-related thing.

@isaacs isaacs closed this Nov 2, 2011

@devansh

This comment has been minimized.

Show comment
Hide comment
@devansh

devansh Nov 3, 2011

@bobrik
Using the command you suggest says : curl couldn't connect to host

@isaacs

  1. when I use the debug mode the sh file still stops on " Failed to get tarball url for npm/latest" .
  2. I am using ubuntu server 10.04 on a virtual machine hosted on Windows XP(If relevant, my network adaptor for the VM is NAT).
  3. I have also tried installing by cloning from the git but that too gives me the following error after I sudo make install :

Clone of 'https://github.com/isaacs/abbrev-js.git' into submodule path 'node_modules/abbrev' failed

4.I also followed your instructions in #1540 where in you have told to use the following command:

(curl -SsL -k https://registry.npmjs.org/npm/latest; echo "") | sed -e 's/^.*tarball":"//' | sed -e 's/".*$//' 

and i get the output as nothing. The prompt simply returns. I am at a loss on what to do. I need to install npm urgently. I thought of installing by downloading from tarball but the guy in issue#1540 had some issues with that too.But I guess I will give it a try too. TIA

devansh commented Nov 3, 2011

@bobrik
Using the command you suggest says : curl couldn't connect to host

@isaacs

  1. when I use the debug mode the sh file still stops on " Failed to get tarball url for npm/latest" .
  2. I am using ubuntu server 10.04 on a virtual machine hosted on Windows XP(If relevant, my network adaptor for the VM is NAT).
  3. I have also tried installing by cloning from the git but that too gives me the following error after I sudo make install :

Clone of 'https://github.com/isaacs/abbrev-js.git' into submodule path 'node_modules/abbrev' failed

4.I also followed your instructions in #1540 where in you have told to use the following command:

(curl -SsL -k https://registry.npmjs.org/npm/latest; echo "") | sed -e 's/^.*tarball":"//' | sed -e 's/".*$//' 

and i get the output as nothing. The prompt simply returns. I am at a loss on what to do. I need to install npm urgently. I thought of installing by downloading from tarball but the guy in issue#1540 had some issues with that too.But I guess I will give it a try too. TIA

@devansh

This comment has been minimized.

Show comment
Hide comment
@devansh

devansh Nov 3, 2011

@isaacs
I also tried installing by downloading the tarball from :http://registry.npmjs.org/npm/-/npm-1.0.96.tgz and then untar-ing it and then ./configure and sudo make install but I am having the same problem as issue#1540 (#1540)

devansh commented Nov 3, 2011

@isaacs
I also tried installing by downloading the tarball from :http://registry.npmjs.org/npm/-/npm-1.0.96.tgz and then untar-ing it and then ./configure and sudo make install but I am having the same problem as issue#1540 (#1540)

@devansh

This comment has been minimized.

Show comment
Hide comment
@devansh

devansh Nov 4, 2011

does it have to do something with me using http:// instead of https:// because https:// does not install? It says curl couldn't connect.

And moreover using the s command for getting the url does get me : http://registry.npmjs.org/npm/-/npm-1.0.103.tgz when I use http:// instead of https://.

I guess I am right and also a complete novice if I understand it now that this might be a issue of my office network.

devansh commented Nov 4, 2011

does it have to do something with me using http:// instead of https:// because https:// does not install? It says curl couldn't connect.

And moreover using the s command for getting the url does get me : http://registry.npmjs.org/npm/-/npm-1.0.103.tgz when I use http:// instead of https://.

I guess I am right and also a complete novice if I understand it now that this might be a issue of my office network.

@isaacs

This comment has been minimized.

Show comment
Hide comment
@isaacs

isaacs Nov 5, 2011

Member

@devansh I think you are correct, and that this is a network issue on your end. I'm not sure how to help you.

Member

isaacs commented Nov 5, 2011

@devansh I think you are correct, and that this is a network issue on your end. I'm not sure how to help you.

@snatesan

This comment has been minimized.

Show comment
Hide comment
@snatesan

snatesan Nov 15, 2011

@isaacs, @devansh I guess this is because of SSL certificate verification failure. curl performs it by default. Using -k option will turn off curl's verification of the certificate

snatesan commented Nov 15, 2011

@isaacs, @devansh I guess this is because of SSL certificate verification failure. curl performs it by default. Using -k option will turn off curl's verification of the certificate

@devansh

This comment has been minimized.

Show comment
Hide comment
@devansh

devansh Nov 22, 2011

@snatesan
Yup, you are right. Had to set up proxy for https server too

devansh commented Nov 22, 2011

@snatesan
Yup, you are right. Had to set up proxy for https server too

@sandeepmeher

This comment has been minimized.

Show comment
Hide comment
@sandeepmeher

sandeepmeher Dec 8, 2011

had an issue with the installation due to proxy settings, but managed by adding '-E' to the sudo command. 'sudo -E' allows the proxy environment variables set in the normal user mode.
curl http://npmjs.org/install.sh | sudo -E npm_debug=1 bash
... and i had to replace sh with bash (Ubuntu 11.10)

sandeepmeher commented Dec 8, 2011

had an issue with the installation due to proxy settings, but managed by adding '-E' to the sudo command. 'sudo -E' allows the proxy environment variables set in the normal user mode.
curl http://npmjs.org/install.sh | sudo -E npm_debug=1 bash
... and i had to replace sh with bash (Ubuntu 11.10)

@mikermcneil

This comment has been minimized.

Show comment
Hide comment
@mikermcneil

mikermcneil Mar 16, 2013

Hey guys, for posterity, now it's:

curl https://npmjs.org/install.sh | sudo sh

homeboy's using ssl

mikermcneil commented Mar 16, 2013

Hey guys, for posterity, now it's:

curl https://npmjs.org/install.sh | sudo sh

homeboy's using ssl

@mikermcneil

This comment has been minimized.

Show comment
Hide comment
@mikermcneil

mikermcneil Apr 2, 2013

And by the way, in case this helps anyone else out: It's possible to get into a weird wormhole where you start getting ENOENT and lstat errors and stuff, particularly if you've been "using" (npm link that is). I'm no expert on any of this stuff, but if you delete your ~/.npm folder, it seems to do the trick.

mikermcneil commented Apr 2, 2013

And by the way, in case this helps anyone else out: It's possible to get into a weird wormhole where you start getting ENOENT and lstat errors and stuff, particularly if you've been "using" (npm link that is). I'm no expert on any of this stuff, but if you delete your ~/.npm folder, it seems to do the trick.

@aclave1

This comment has been minimized.

Show comment
Hide comment
@aclave1

aclave1 Dec 6, 2013

I get this same issue, I fixed it with:

 curl http://npmjs.org/install.sh -o install.sh 
 sudo chmod 777 install.sh
 sudo ./install.sh

aclave1 commented Dec 6, 2013

I get this same issue, I fixed it with:

 curl http://npmjs.org/install.sh -o install.sh 
 sudo chmod 777 install.sh
 sudo ./install.sh
@mehmetyaman

This comment has been minimized.

Show comment
Hide comment
@mehmetyaman

mehmetyaman Feb 22, 2014

i'm getting same error
301 Moved Permanently
i tought that the page has been removed,

mehmetyaman commented Feb 22, 2014

i'm getting same error
301 Moved Permanently
i tought that the page has been removed,

@isaacs

This comment has been minimized.

Show comment
Hide comment
@isaacs

isaacs Feb 22, 2014

Member

The page hasn't been removed. It's been moved. Permanently.

Add -L to your curl command.

Member

isaacs commented Feb 22, 2014

The page hasn't been removed. It's been moved. Permanently.

Add -L to your curl command.

@BrandonMathis

This comment has been minimized.

Show comment
Hide comment
@BrandonMathis

BrandonMathis Feb 25, 2015

Where has it been moved to?

BrandonMathis commented Feb 25, 2015

Where has it been moved to?

@debashish216

This comment has been minimized.

Show comment
Hide comment
@debashish216

debashish216 Mar 16, 2015

Try this,,It will work..
sudo curl -k -L https://npmjs.org/install.sh | sudo sh

debashish216 commented Mar 16, 2015

Try this,,It will work..
sudo curl -k -L https://npmjs.org/install.sh | sudo sh

@ivan-kleshnin

This comment has been minimized.

Show comment
Hide comment
@ivan-kleshnin

ivan-kleshnin Apr 8, 2015

I forgot how many times I runned npm update npm -g without sudo and got npm breaked because it unlinks everything at the beginning. So annoying.

ivan-kleshnin commented Apr 8, 2015

I forgot how many times I runned npm update npm -g without sudo and got npm breaked because it unlinks everything at the beginning. So annoying.

@vkrishnasamy

This comment has been minimized.

Show comment
Hide comment
@vkrishnasamy

vkrishnasamy Aug 17, 2016

Debashish. Thanks. I had the same issue.. it is simply moved and got it to work by this -L. Super.

vkrishnasamy commented Aug 17, 2016

Debashish. Thanks. I had the same issue.. it is simply moved and got it to work by this -L. Super.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.