gruntjs - Yeoman 使用 "grunt"命令启动项目时出错

标签 gruntjs yeoman yeoman-generator-angular

我正在关注 yeoman 教程 http://yeoman.io/codelab/prepare-production.html一切工作正常,直到我尝试使用“grunt”命令启动我的项目,然后出现以下错误:

Running "autoprefixer:dist" (autoprefixer) taskAutoprefixer's process() method is deprecated and will removed in next major release. Use postcss([autoprefixer]).process() insteadFile .tmp/styles/main.css created.
jit-grunt: Plugin for the "ngtemplates" task not found.If you have installed the plugin already, please setting the static mapping.See https://github.com/shootaroo/jit-grunt#static-mappings
Warning: Task "ngtemplates" failed. Use --force to continue.
Aborted due to warnings.

我使用 Linux Mint 17

最佳答案

A workaround发布在生成器角度 github 上。尝试修改 Gruntfile.js 以使 jit-grunt block 如下所示:

// Automatically load required Grunt tasks
require('jit-grunt')(grunt, {
  useminPrepare: 'grunt-usemin',
  ngtemplates: 'grunt-angular-templates',
  cdnify: 'grunt-google-cdn'
});

关于gruntjs - Yeoman 使用 "grunt"命令启动项目时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31166376/

相关文章:

node.js - 获取 npm : command not found. 已安装 Node 时如何重新安装 NPM? NPM 去哪儿了?

node.js - 最新的 grunt-express 不起作用

javascript - 我如何使用 Grunt 自动引用 HTML 中的新(缩小和连接)JavaScript 文件?

angularjs - 为 Webpack 4 加载 AngularJS 模板的正确方法?

javascript - 使用 grunt 运行 2 个异步任务

sass - Yeoman:在 SCSS 文件更改时触发 LiveReload

django - 使用 Django 设置 Yeoman

gruntjs - usemin 并使用 Grunt 重写供应商 CSS 文件中图像的 url

javascript - 如何在同一个域上运行 2 个 AngularJS 应用程序?

javascript - 如何在 PhantomJS 测试中 ng-click A 指令