我让 grunt 在本地运行得很好,但是在设置我的 Jenkins 服务器做同样的事情之后,我遇到了 grunt 无法找到 grunt 文件的问题。我可能错过了安装/配置的东西吗?我无法从错误输出中判断出什么问题,这是我在 jenkins 盒子上得到的:
[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']);
};
最佳答案
你有没有在你的 Jenkins 服务器上安装 grunt?
npm install grunt
关于javascript - 找不到本地grunt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15622869/