我已经 grunt 在本地运行得很好,但是在设置我的 Jenkins 服务器做同样的事情之后,我遇到了 grunt 无法找到 grunt 文件的问题。我可能错过了安装/配置的东西吗?我无法从错误输出中判断出什么问题,这是我在詹金斯盒子上得到的:
[user@buildserver]# ls
AUTHORS CHANGELOG coverage Gruntfile.js package.json README.md reports spec src
[user@buildserver]# 咕噜
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']);
};