Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"sh: line 1: Moved: command not found" installing npm with curl | sh

I attempted to install npm on mac OSX Yosemite with the command:

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

And I received the following message:

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    51  100    51    0     0    296      0 --:--:-- --:--:-- --:--:--   298

sh: line 1: Moved: command not found

Any suggestions on how to resolve this issue?

like image 823
andres Avatar asked Mar 24 '15 20:03

andres


2 Answers

You're missing the curl -L option to follow redirects. However, you don't need to use this installation method anymore, npm comes with node and if your distro happens to split node's components up, npm is usually available as a separate package from one of your distro's repositories.

like image 173
mscdex Avatar answered Oct 13 '22 00:10

mscdex


I had to figure out where my node application was installed and add that to path. I used the first method listed here: https://gist.github.com/isaacs/579814 so turns out "node" was in /home/myname/node-latest-install/~/local/bin.

Adding that to PATH, then doing curl -L https://www.npmjs.org/install.sh | sh worked for me.

like image 37
Matthew Avatar answered Oct 12 '22 23:10

Matthew