linux - "sh: line 1: Moved: command not found"使用 curl 安装 npm |嘘

标签 linux node.js bash shell curl

我尝试使用以下命令在 mac OSX Yosemite 上安装 npm:

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

我收到了以下消息:

% 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

关于如何解决这个问题有什么建议吗?

最佳答案

您缺少用于跟随重定向的 curl -L 选项。但是,您不需要再使用这种安装方法,npm 随 node 一起提供,如果您的发行版碰巧将 node 的组件拆分开来,npm 通常作为您的发行版存储库之一的单独包提供。

关于linux - "sh: line 1: Moved: command not found"使用 curl 安装 npm |嘘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29242217/

相关文章:

python - 为什么相同的请求会在两台机器上导致不同的状态代码 200 和 429?

php - linux 命令运行带参数的 php 文件函数

c++ - 如何在mmap中使用PERF_SAMPLE_READ

c - 在 Linux 上分发 .so 文件?

javascript - Node 套接字挂断错误与http

node.js - Node example.js 和三个点,接下来是什么?

macos - 获取脚本中 OS X shell 脚本所在的路径...当路径有空格时

javascript - 使用 Angular 比 Swig 更有效地解释来自路线的数据?

bash - Go Sha256Sum 与 Bash sha256sum 的区别

Linux lsof 需要帮助解析输出