是什么导致“grunt serve"抛出“No Bower components found"? [英] What is causing 'grunt serve' to throw 'No Bower components found'?

查看:28
本文介绍了是什么导致“grunt serve"抛出“No Bower components found"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始在我的 Windows 7 盒子中使用 angular-fullstack Angular 应用程序.我安装了一堆带有 -g 选项的 npm 包,包括 grunt-bower-install.我首先通过运行

I am starting out angular app with angular-fullstack in my Windows 7 box. I installed bunch of npm packages with -g options, including grunt-bower-install. I created the application first by running

哟 angular-fullstack 应用程序名称

yo angular-fullstack appname

在应用程序创建过程中没有异常.成功创建应用程序后,我尝试使用

There were no exception during the application creation. After application was created successfully I tried to run the app using

咕噜咕噜的服务

期待服务器运行.但是 'grunt serve' 因

expecting the server to run. But the 'grunt serve' failed with

运行bower-install:app"(凉亭安装)任务找不到保存 Bower 包裹的位置.

Running "bower-install:app" (bower-install) task Cannot find where you keep your Bower packages.

我们尝试寻找 .bowerrc 文件,但找不到自定义directory 属性定义.然后我们尝试了 bower_components,但是看起来也不存在.作为最后的手段,我们尝试了1.0 之前的 components 目录,但也找不到.

We tried looking for a .bowerrc file, but couldn't find a custom directory property defined. We then tried bower_components, but it looks like that doesn't exist either. As a last resort, we tried the pre-1.0 components directory, but that also couldn't be found.

不幸的是,如果不知道凉亭在哪里,我们就无法继续您安装的软件包是.

Unfortunately, we can't proceed without knowing where the Bower packages you have installed are.

致命错误:未找到 Bower 组件.

我确实找到了 .bowerrc 文件,它指向 app/bower_components.不幸的是,找不到 bower_components 文件.我不确定自己创建文件的内容应该是什么.是丢失的文件导致了这个问题还是有 npm 包,我没有正确安装?

I did find .bowerrc file and it was pointing to app/bower_components. Unfortunately, bower_components file was no where to be found. I am not sure what should be the content of the file to create it myself. Is it the missing file causing this problem or is there a npm package, I did not install correctly?

  • 我也使用 npm 安装了 bower *

谢谢

推荐答案

我遇到了同样的问题,以下是我的情况:

I had the same issue, here's what worked in my case:

  1. 安装了 ruby​​ 和指南针(自耕农需要这些)
  2. 已验证 Ruby bin 文件夹的路径已添加到 %PATH%
  3. 安装 Git
  4. 重新启动 cmd 窗口并在应用程序文件夹中运行bower install"

在那之后,grunt serve 命令完美运行.注意:也许在您的情况下安装 Git 并运行 bower install 就足够了.

After that, grunt serve command worked perfectly. Note: maybe installing Git and running bower install would suffice in your case.

这篇关于是什么导致“grunt serve"抛出“No Bower components found"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆