linux - 在位置 2 安装带有 NVM 不匹配支架的 NPM

标签 linux node.js npm nvm

我正在努力安装 NPM,但遇到错误。这是我尝试过的地方:

b-2:bin X$ nvm use v0.4.12
Now using node v0.4.12
b-2:bin X$ curl https://npmjs.org/install.sh  | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7882  100  7882    0     0  17347      0 --:--:-- --:--:-- --:--:-- 22140
tar=/usr/bin/tar
version:
bsdtar 2.8.3 - libarchive 2.8.3
install npm@1.0
fetching: {
curl: (3) [globbing] unmatched brace at pos 2
npm-install-30810.sh: line 228: cd: /var/folders/g_/kythn1dx4fbbry5npb4jx1cr0000gn/T//npm.30813/*: No such file or directory
It failed

为什么 NPM 没有安装?

最佳答案

对于 Node 0.4.x,您需要 npm 1.0.x,但是...

npmjs.org 似乎不再提供 npm 1.0。安装脚本 install.sh 正在尝试从 https://registry.npmjs.org/npm/1.0 下载元数据 json 文件。现在包含:

{"error":"version not found: 1.0"}

但是你仍然可以从头开始构建它,从 github 克隆 1.0 分支:

$ git clone https://github.com/isaacs/npm.git npm
$ cd npm
$ git checkout 1.0
$ ./configure
$ make
$ make install
$ npm -v
1.0.106

关于linux - 在位置 2 安装带有 NVM 不匹配支架的 NPM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18035766/

相关文章:

linux - 如何同时打开三个终端(进程)

linux - 如何有效维护我的SSD磁盘?

Javascript 对象 - 整体对象缺少的功能,但存在

javascript - 如何解决这个 npm glob-parent 问题

javascript - 如何在 next.js 中设置端口

linux - apache 中的文件持久化

c++ - OpenCascade中的奇怪段错误

node.js - 在 Windows 上使用 NUL dir 搞乱了我的 Git

node.js - 使用主干和 Node.js 进行 CSRF 防御

node.js - npm启动错误: Cannot find module 'C:\' and Exit status 8