无法找到当地的咕噜声

Zug*_*dud 12 javascript gruntjs

我已经在本地运行这个很好的grunt,但是在设置我的Jenkins服务器做同样的事情之后我遇到了grunt无法找到grunt文件的问题.我可能错过了安装/配置的东西吗?我不知道错误输出有什么问题,这是我在jenkins盒子上得到的:

[user @ buildserver] #ls

AUTHORS  CHANGELOG  coverage  Gruntfile.js  package.json  README.md  reports  spec  src
Run Code Online (Sandbox Code Playgroud)

[user @ buildserver] #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
Run Code Online (Sandbox Code Playgroud)

这是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']);
};                                      
Run Code Online (Sandbox Code Playgroud)

Vit*_*huk 18

你在Jenkins服务器上安装了grunt吗?

npm install grunt
Run Code Online (Sandbox Code Playgroud)

  • @Hoofamon根据0.4版你必须使用全局`grunt-cli`和本地`grunt` http://gruntjs.com/getting-started (6认同)