javascript - 找不到本地grunt

标签 javascript gruntjs

我让 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/

相关文章:

javascript - 选择父元素的最后两项,添加类并对它们应用更改->不工作

javascript - Google数据可视化使用两个数据集堆叠条形图

javascript - 画一条连续动画的线

javascript - 我如何根据复选框的状态更改另一种已具有自己样式表的媒体类型的 CSS 值?

git - .gitignore 不忽略 package.json

sass - Grunt 不更新主 scss 文件

javascript - Node.js 使用回调函数更改 HTML 代码

javascript - 如何使用 load-grunt-config 将参数传递给外部文件中定义的 grunt 任务?

angularjs - 警告 : Running "compass:server" (compass) task

linux - 为 ubuntu 14.04 grunt 命令配置 yeoman 不起作用