DragonS
DragonS

Reputation: 41

Can someone help me resolve this problem? Fatal error: Unable to find local grunt

I am learning hybris and I started using smartedit. The problem is that when I run ant clean all or ant updatesystem I get this error.

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

What have I done till now:

I have grunt-cli installed globally, and grunt installed locally. Also, I run npm install.

Here is my packege.json file:

{
  "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"
}

Here is my 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']);

};

I tried a bunch of ways to resolve this problem but nothing seemed to work. Can someone help me out?

Upvotes: 1

Views: 267

Answers (0)

Related Questions