按照设置grunt角度模板的说明进行操作:https://npmjs.org/package/grunt-angular-templates
我通过执行以下操作安装grunt-angular-template:
npm install grunt-angular-templates --save-dev
安装。
我的package.json非常简单:
{
"name": "grunt_example2",
"version": "0.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"grunt-angular-templates": "~0.4.7"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "BSD-2-Clause"
}
我创建了一个Gruntfile.js作为
module.exports = function(grunt) {
grunt.loadTasks('grunt-angular-templates');
}
当我这样做时:
grunt ngtemplates
我得到: 致命错误:无法找到当地的咕噜声。
If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:
http://gruntjs.com/getting-started
但这对我如何解决这个问题一无所知。
任何提示?
感谢。
答案 0 :(得分:1)
您需要在项目中安装grunt。见这里:http://gruntjs.com/getting-started#installing-grunt-and-gruntplugins
npm install grunt --save-dev