1

我正在学习 hybris,并开始使用 smartedit。问题是当我运行ant clean allant updatesystem出现此错误时。

Running grunt default
grunt-cli: The grunt command line interface (v1.3.2)

Fatal error: Unable to find local grunt.

If you're seeing this message, grunt hasn't been installed locally to
your project. For more information about installing and configuring grunt,
please see the Getting Started guide:

https://gruntjs.com/getting-started

到目前为止我做了什么:

我已经全局安装了 grunt-cli,并在本地安装了 grunt。另外,我运行npm install.

这是我的 packege.json 文件:

{
  "name": "name",
  "version": "1.0.0",
  "main": "index.js",
  "directories": {
    "lib": "lib"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "grunt": "^1.4.1",
    "grunt-contrib-jshint": "^3.0.0",
    "grunt-contrib-watch": "^1.1.0"
  },
  "dependencies": {},
  "description": "desc"
}

这是我的 Gruntfile.js:

module.exports = function(grunt) {

  grunt.initConfig({
    jshint: {
      files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js'],
      options: {
        globals: {
          jQuery: true
        }
      }
    },
    watch: {
      files: ['<%= jshint.files %>'],
      tasks: ['jshint']
    }
  });

  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');

  grunt.registerTask('default', ['jshint']);

};

我尝试了很多方法来解决这个问题,但似乎没有任何效果。有人可以帮我吗?

4

0 回答 0