我已经在本地运行成功了,但是在设置了 Jenkins 服务器之后,遇到了 grunt 无法找到 grunt 文件的问题。我可能错过了安装或配置某些内容吗?从错误输出中无法判断出错的原因,以下是 Jenkins 服务器上的输出:
[user@buildserver]# ls
AUTHORS CHANGELOG coverage Gruntfile.js package.json README.md reports spec src
[用户@构建服务器]#grunt
grunt-cli: The grunt command line interface. (v0.1.6)
Fatal error: Unable to find local grunt.
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
这是Gruntfile.js的文件。
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
jasmine : {
src : 'src/**/*.js',
options : {
specs : 'spec/**/*.js',
template : require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'reports/coverage.json',
report: 'reports/coverage'
}
}
},
});
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.registerTask('default', ['jasmine']);
};
grunt-cli
和本地的grunt
。详情请见:http://gruntjs.com/getting-started - Vitalii Petrychuk