【问题标题】:Installing NPM with NVM unmatched brace at pos 2在 pos 2 使用 NVM 不匹配的大括号安装 NPM
【发布时间】:2013-08-03 18:05:49
【问题描述】:

我正在安装 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 没有安装?谢谢

【问题讨论】:

    标签: linux node.js npm nvm


    【解决方案1】:

    对于节点 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-17
      • 1970-01-01
      • 2017-03-07
      • 2018-03-06
      • 1970-01-01
      相关资源
      最近更新 更多