簡體   English   中英

無法找到當地的咕嚕聲

[英]Unable to find local grunt

我已經在本地運行這個很好的grunt,但是在設置我的Jenkins服務器做同樣的事情之后我遇到了grunt無法找到grunt文件的問題。 我可能錯過了安裝/配置的東西嗎? 我不知道錯誤輸出有什么問題,這是我在jenkins盒子上得到的:

[user @ buildserver] #ls

AUTHORS  CHANGELOG  coverage  Gruntfile.js  package.json  README.md  reports  spec  src

[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

這是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

你可以從jenkins管理界面設置一切,你不需要在本地安裝grunt :)

安裝Jenkins插件

  • Git插件 - 對於git
  • Git客戶端插件 - 用於git
  • Git參數插件 - 用於git標簽
  • GitHub API插件 - 用於github
  • NodeJS插件 - 集成常見的JavaScript工具NodeJS&npm

Git / Ant / Maven / NodeJS安裝

  • 轉到SERVER / jenkins / configure
混帳
  • Git - > Git安裝 - >添加Git - > JGit
  • Git插件 - > Global Config user.name Value =“Anthony Mckale”,Global Config user.email Value =“anthony.mckale@bskyb.com”
的NodeJS
  • NodeJS-> NodeJS安裝 - >添加NodeJS - > Name =“NodeJS 0.11.10”,勾選“自動安裝”,選擇“從nodejs.org安裝”,將“grunt-cli”添加到全局安裝的包中

TADA

希望git / nodejs和grunt可供您使用

有關如何將grunt / node任務添加到jenkins作業的詳細信息,請參閱插件維基 - > https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin

這真的很容易:)

沒有ssh loggin只需要jenkins管理員權限

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM