2014-03-27 84 views
0

我只是试图运行Angular-bootstrap发电机,并回答所有的选项,所以:咕噜错误 - 警告:任务“亭子安装”找不到

[?] What version of angular would you like to use? 1.2.15 
[?] Which official angular modules would you need? animate, route 
[?] Any third-party component you may require? bootstrap#~3.1.0 
[?] Would you want me to support old versions of Internet Explorer (eg. before IE9)? nose arrow keys) 
[?] Should I set up one of those JS preprocessors for you? none 
[?] Should I set up one of those CSS preprocessors for you? sass 
[?] What's the base name of your project? bootstrap 
[?] Under which lincense your project shall be released? MIT 
[?] Would you mind telling me your username on GitHub? mgcrea 

一切都正常运行和花花公子,但是当我尝试并运行服务咕噜咕噜或建立我得到以下错误:Warning: Task "bower-install" not found. Use --force to continue.

我试图凉亭运行安装& NPM安装修复这个错误,但我得到如下:N pm WARN package.json [email protected] No README data

有没有人关于如何解决这个问题的任何建议?

+0

为了克服这个问题我刚刚手动添加的模块运行角度发生器之后 –

+0

你应该真的发布答案作为“答案”而不是“评论” – anders

+0

这不是一个答案,它只是一个解决方法,他用来继续他自己的工作......并且该解决方法不能回答问题 – thermz

回答

3

请尝试以下方法:

  1. 尝试用“bowerInstall” - 不是“亭子安装”作为该选项在以后的版本 被重命名(见https://github.com/mgcrea/generator-angular-bootstrap/issues/2

  2. 确保你从您的应用程序的根目录运行bowerInstall

  3. 看看您的Gruntfile.js - 是否有函数“bowerInstall”?如果没有,只是添加:

    bowerInstall: { 
        target: { 
    
         // Point to the files that should be updated when 
         // you run `grunt bower-install` 
         src: [ 
          'app/views/**/*.html', // .html support... 
          'app/*.html', // .html support... 
         ], 
    
         // Optional: 
         // --------- 
         cwd: '', 
         dependencies: true, 
         devDependencies: false, 
         exclude: [], 
         fileTypes: {}, 
         ignorePath: '', 
         overrides: {} 
        } 
    } 
    

    您可以将功能filerev之后添加此功能,例如:{....}

  4. 确保已安装的程序包“咕噜,bower-安装”。看看你的package.json。你会发现下面的行:

    "grunt-bower-install": "^1.6.0",

    如果没有,只是添加它,然后运行:

    npm install

    grunt

+0

正在运行执行grunt之前本地的“npm install”命令是m为我迈出了一步。 – sfuqua