0

我正在尝试构建在这里找到的骨干样板项目:https ://github.com/backbone-boilerplate/backbone-boilerplate

我在让它正确构建时遇到了一些问题。以下是我已经完成的步骤,这些步骤是主干样板 wiki 上的步骤:

git clone https://github.com/backbone-boilerplate/backbone-boilerplate.git
cd backbone-boilerplate
sudo npm install -gq bower
sudo npm install -q
sudo npm install -gq grunt-cli
sudo grunt

此时我得到:

>> Local Npm module "grunt-cli" not found. Is it installed?
Warning: Task "requirejs" not found. Use --force to continue.

Aborted due to warnings.

任何想法如何让它正确构建?

4

3 回答 3

0

您正在grunt提升的权限下运行。我们在此处构建的文档:

https://github.com/backbone-boilerplate/backbone-boilerplate#build-process

...您是否在自己的用户下运行该命令。试一试!

于 2013-10-01T20:18:52.573 回答
0

指定深度似乎有效:

$ git clone --depth 1 https://github.com/backbone-boilerplate/backbone-boilerplate.git
$ npm install
$ grunt

如果这是您第一次安装,您可能还需要重新启动终端grunt-cli

于 2013-09-29T08:56:55.607 回答
0

您需要确保使用 bower 构建依赖关系,而不仅仅是节点依赖关系。

入门

# Using Git, fetch only the latest commits.  You won't need the full history
# for your project.
git clone --depth 1 https://github.com/backbone-boilerplate/backbone-boilerplate

# Move the repository to your own project name.
mv backbone-boilerplate my-project

更新依赖

# Install global dependencies.  Depending on your user account you may need to
# gain elevated privileges using something like `sudo`.
npm install -g grunt-cli bower

# Optionally install coveralls (integration is baked in with Travis CI).
npm install -g coveralls

# Install NPM dependencies.
npm install

# Install Bower dependencies. ** THIS IS THE ONE YOU'VE MISSED **
bower install

构建过程

# To run the build process, run the default Grunt task.
grunt

# Run a build and test the now optimized assets.
grunt default server:release

如果您正确安装了节点,这应该就像一个魅力。

于 2014-04-26T05:52:16.423 回答