使用bower install -g在Mac OS上安装bootstrap时遇到问题(安装了git)

时间:2016-04-05 05:27:41

标签: git macos bower

我已经查看了各种答案,但似乎无法确定我的具体问题的解决方案。我在macbook air(10.7.5)上安装了node.js.我安装了凉亭。一切顺利。然后,当我尝试安装bootstrap时,出现以下错误。

$ bower install -g bootstrap

bower not-cached    git://github.com/twbs/bootstrap.git#*

bower resolve       git://github.com/twbs/bootstrap.git#*

bower ENORESTARGET  Tag/branch master does not exist

Additional error details:

No tags found in git://github.com/twbs/bootstrap.git

No branches found in git://github.com/twbs/bootstrap.git


# The following command works:

$ which git

/usr/local/bin/git


# I tried this (some suggestion from another post):

$ git clone https://github.com/git/git

Illegal instruction: 4

非常感谢任何帮助。感谢

1 个答案:

答案 0 :(得分:0)

通常您在项目目录中安装bower。首先安装凉亭(你已经完成了)。然后使用bower init在项目中初始化它。这看起来像是:

$ bower init
? name test
? description bla bla some 
? main file 
? what types of modules does this package expose? 
? keywords 
? authors Haroen Viaene <hello@haroen.me>
? license MIT
? would you like to mark this package as private which prevents it from being accidentally published to the registry? (y/N) y
{
  name: 'test',y? (y/N) 
  authors: [
    'Haroen Viaene <hello@haroen.me>'
  ],
  description: 'bla bla some',
  main: '',
  moduleType: [],
  license: 'MIT',
  homepage: '',
  ignore: [
    '**/.*',
    'node_modules',
    'bower_components',
    'test',
    'tests'
  ]
}

? Looks good? Yes

然后,您可以通过bootstrap安装bower install --save bootstrap。这应该是:

$ bower install --save bootstrap
bower cached        git://github.com/twbs/bootstrap.git#3.3.6
bower validate      3.3.6 against git://github.com/twbs/bootstrap.git#*
bower cached        git://github.com/jquery/jquery-dist.git#2.2.2
bower validate      2.2.2 against git://github.com/jquery/jquery-dist.git#1.9.1 - 2
bower install       bootstrap#3.3.6
bower install       jquery#2.2.2

bootstrap#3.3.6 bower_components/bootstrap
└── jquery#2.2.2

jquery#2.2.2 bower_components/jquery

现在bootstrap应安装在bower_components文件夹中。