如何避免bower自动安装我不需要的包?

时间:2014-08-16 20:02:56

标签: angularjs twitter-bootstrap gruntjs bower

我安装了角带式凉亭包。

angular-strap不依赖于jquery或bootstrap而只是bootstrap.css文件。

当我进行bower更新并更新所有软件包时,bower下载并安装:

bootstrap 3.2包虽然我不需要,因为我使用cdn for bootstrap 3.2 css文件!!!

这是我在'bower update'之后得到的:

C:\ipml>bower update
bower angular-touch#1.2.16      cached git://github.com/angular/bower-angular-touch.git#1.2.16
bower angular-touch#1.2.16    validate 1.2.16 against git://github.com/angular/bower-angular-touch.git#1.2.16
bower angular-animate#1.2.16    cached git://github.com/angular/bower-angular-animate.git#1.2.16
bower angular-animate#1.2.16  validate 1.2.16 against git://github.com/angular/bower-angular-animate.git#1.2.16
bower jquery#~2.1.1             cached git://github.com/jquery/jquery.git#2.1.1
bower jquery#~2.1.1           validate 2.1.1 against git://github.com/jquery/jquery.git#~2.1.1
bower angular#~1.2.22           cached git://github.com/angular/bower-angular.git#1.2.22
bower angular#~1.2.22         validate 1.2.22 against git://github.com/angular/bower-angular.git#~1.2.22
bower angular-strap#~2.0.5      cached git://github.com/mgcrea/angular-strap.git#2.0.5
bower angular-strap#~2.0.5    validate 2.0.5 against git://github.com/mgcrea/angular-strap.git#~2.0.5
bower angular-ui-router#~0.2.10 cached git://github.com/angular-ui/ui-router.git#0.2.10
bower angular-ui-router#~0.2.10         validate 0.2.10 against git://github.com/angular-ui/ui-router.git#~0.2.10
bower angular-mocks#1.2.16                cached git://github.com/angular/bower-angular-mocks.git#1.2.16
bower angular-mocks#1.2.16              validate 1.2.16 against git://github.com/angular/bower-angular-mocks.git#1.2.16
bower angular-scenario#1.2.16             cached git://github.com/angular/bower-angular-scenario.git#1.2.16
bower angular-scenario#1.2.16           validate 1.2.16 against git://github.com/angular/bower-angular-scenario.git#1.2.16
bower bootstrap#^3.2.0                    cached git://github.com/twbs/bootstrap.git#3.2.0
bower bootstrap#^3.2.0                  validate 3.2.0 against git://github.com/twbs/bootstrap.git#^3.2.0
bower angular-motion#^0.3.3               cached git://github.com/mgcrea/angular-motion.git#0.3.3
bower angular-motion#^0.3.3             validate 0.3.3 against git://github.com/mgcrea/angular-motion.git#^0.3.3
bower angular#1.2.16                      cached git://github.com/angular/bower-angular.git#1.2.16
bower angular#1.2.16                    validate 1.2.16 against git://github.com/angular/bower-angular.git#1.2.16

Please note that,
    angular-animate#1.2.16, angular-mocks#1.2.16, angular-scenario#1.2.16, angular-touch#1.2.16 depends on angular#1.2.16 which resolved to angular#1.2.16
    ipml depends on angular#~1.2.22 which resolved to angular#1.2.22
    angular-ui-router#0.2.10 depends on angular#>= 1.0.8 which resolved to angular#1.2.22
    angular-strap#2.0.5 depends on angular#^1.2.21 which resolved to angular#1.2.22
    angular-motion#0.3.3 depends on angular#~1.2.10 which resolved to angular#1.2.22

Resort to using angular#~1.2.22 which resolved to angular#1.2.22
Code incompatibilities may occur.

bower bootstrap#^3.2.0                   install bootstrap#3.2.0

bootstrap#3.2.0 bower_components\bootstrap
└── jquery#2.1.1

糟糕的是当我这样做时:'bower卸载bootstrap --save'然后删除bootstrap,当我做下一个'grunt build'时,我总是得到这个消息而不能继续:/

Running "wiredep:app" (wiredep) task
Warning: Cannot read property 'main' of undefined Use --force to continue.

Aborted due to warnings.

这是我的凉亭文件:

{
  "name": "ipml",
  "version": "0.0.0",
  "dependencies": {
    "angular-animate": "1.2.16",
    "angular-touch": "1.2.16",
    "jquery": "~2.1.1",
    "angular-ui-router": "~0.2.10",
    "angular-strap": "~2.0.5",
    "angular": "~1.2.22"
  },
  "devDependencies": {
    "angular-mocks": "1.2.16",
    "angular-scenario": "1.2.16"
  },
  "appPath": "app",
  "resolutions": {
    "angular": "~1.2.22"
  }
}

如何在不再获取“无法读取属性'主'...”消息的情况下删除bootstrap bower包,这会阻止我使用grunt构建我的代码?

0 个答案:

没有答案