"sh: line 1: moved: command not found" npm installation with curl | w

I tried installing npm on Mac OSX Yosemite using the command:

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

And I got 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 to fix this problem?

+6
source share
2 answers

You are missing the curl -L option to follow the redirection. However, you no longer need to use this installation method, npm comes with node, and if your distribution comes with the node component section, npm is usually available as a separate package from one of your registry repositories.

+13
source

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

Add this to PATH, then do curl -L https://www.npmjs.org/install.sh | w worked for me.

+2
source

Source: https://habr.com/ru/post/984210/


All Articles