Skip to content
Advertisement

“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?

Advertisement

Answer

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.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement