[英]How do I build backbone boilerplate with grunt?
我正在尝试构建在这里找到的骨干样板项目: 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.
任何想法如何使它正确构建?
指定深度似乎有效:
$ git clone --depth 1 https://github.com/backbone-boilerplate/backbone-boilerplate.git
$ npm install
$ grunt
另外,如果这是您第一次安装grunt-cli
,则可能要重新启动终端
您正在特权下运行grunt
。 我们在此处构建的文档:
https://github.com/backbone-boilerplate/backbone-boilerplate#build-process
...您是否已在自己的用户下运行该命令。 试一试!
您需要确保使用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
如果正确安装了节点,则应该像超级按钮一样工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.