0

我一直在使用这个种子,我之前没有遇到过这个错误,我已经grunt serve无数次发出了这个命令——我现在才得到这个错误。我做的唯一可能导致它的事情是我删除了包含我的项目的目录 - 并用于git clone克隆我正在存储我的项目的存储库,因为我想恢复到旧版本。现在我得到这个错误:

Cannot find where you keep your Bower packages.

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.

Fatal error: No Bower components found.

我有一个bower_components目录(它应该在哪里) - 我不确定为什么它没有被看到。我在堆栈上发现了这个——但这似乎不是我的问题,我尝试运行bower install——它没有抛出任何错误,但也没有解决问题。谢谢。

更新

我想我意识到发生了什么,但我不确定该怎么做(除了从种子重新安装并复制我的所有代码)。我认为当我推送到 git 时种子(默认情况下)会遗漏文件(也许是.bowerrc文件?) - 所以当我克隆时,我没有得到我需要的所有文件 - 有什么建议可以解决这个问题吗?

4

1 回答 1

0

我的建议是跑

npm update

希望你会看到它为你安装一切。

跟进

bower install

只要您的存储库中包含 bower.json 文件,这应该可以解决您的问题 - 尽管像我一样,您可能会在默认的 grunt(测试)下发现 karma.conf.js 丢失。

.bowerrc 的内容,如果你需要的话

{
    "directory": "app/bower_components"
}
于 2014-06-05T05:53:36.120 回答