Git Product home page Git Product logo

Comments (22)

pixelzoom avatar pixelzoom commented on May 27, 2024

Reverting to grunt-cli 0.1.8 fixes the problem: sudo npm install -g [email protected]

So this would appear to be something that was introduced in 0.1.9.

from grunt-cli.

samreid avatar samreid commented on May 27, 2024

I'm having the same problem. Here is my version information:

Windows 8 x64
$ npm --version
1.3.2

$ grunt --version
grunt-cli v0.1.9
grunt v0.4.1

from grunt-cli.

paynecodes avatar paynecodes commented on May 27, 2024

Could this have anything to do with:

If youre seeing this message, either a Gruntfile wasnt found or 'grunt
hasnt been installed locally to your project'. For more information about
installing and configuring grunt, please see the Getting Started guide:

You say that you have installed it globally.

from grunt-cli.

pixelzoom avatar pixelzoom commented on May 27, 2024

Please re-read the original report. I indicated that I installed grunt-cli globally and grunt locally, as recommended by the grunt installation instructions. The grunt-cli is installed globally in /usr/local/bin/grunt. And grunt is installed locally, as verified by 'npm ls | grep grunt'.

from grunt-cli.

pixelzoom avatar pixelzoom commented on May 27, 2024

The complete steps I followed to install grunt-cli globally and grunt locally, and the resulting error.

% sudo npm install -g grunt-cli
% grunt --version
grunt-cli v0.1.9
grunt v0.4.1
% cd my-project
% cat package.json
{
  "name": "my-project",
  "version": "0.0.0-1",
  "license": "GPLv3",
  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-requirejs": "~0.3.2",
    "grunt-contrib-jshint": "~0.5.4"
  }
}
% npm install
% npm ls | grep grunt
├─┬ grunt@0.4.1
├─┬ grunt-contrib-jshint@0.5.4
└─┬ grunt-requirejs@0.3.5
  ├─┬ grunt-backbonebuilder@0.1.4
   └─┬ grunt@0.3.17
  ├─┬ grunt-jquerybuilder@0.1.4
   ├─┬ grunt-contrib-jshint@0.1.1
   ├─┬ grunt-contrib-nodeunit@0.1.2
   ├─┬ grunt-contrib-watch@0.2.0
  ├─┬ grunt-lodashbuilder@0.1.7
   ├─┬ grunt-contrib-jshint@0.1.1
   ├─┬ grunt-contrib-nodeunit@0.1.2
   ├─┬ grunt-contrib-watch@0.2.0
% grunt --gruntfile ../chipper/grunt/Gruntfile.js
grunt-cli: The grunt command line interface. (v0.1.9)

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
grunt failed
%

from grunt-cli.

paynecodes avatar paynecodes commented on May 27, 2024

My apologies. I, too am running into this issue now. I had some tasks that were using the Gruntfile.js rather than my altGruntfile.js. So, I removed Gruntfile.js and boom... Fatal error: Unable to find Gruntfile. Even though, I am trying to run this grunt build --gruntfile altGruntfile.js.

I tried sudo npm install -g [email protected], but still receive the same error.

$ grunt --version
grunt-cli v0.1.8
grunt v0.4.1

@pixelzoom Did you do anything other than revert to grunt-cli v0.1.8 to get this working?

from grunt-cli.

pixelzoom avatar pixelzoom commented on May 27, 2024

The only thing I did to workaround this was to revert to the previous version of grunt-cli:

sudo npm install -g grunt-cli@0.1.8

from grunt-cli.

pixelzoom avatar pixelzoom commented on May 27, 2024

Actually... I might have reverted to 0.1.6 first, because that's the version I had before updating. Then I updated to 0.1.8.

from grunt-cli.

paynecodes avatar paynecodes commented on May 27, 2024

Would you happen to be running grunt-concurrent?

If so, please see my issue here: sindresorhus/grunt-concurrent#17

Perhaps this is affecting more than just grunt-concurrent.

from grunt-cli.

pixelzoom avatar pixelzoom commented on May 27, 2024

I'm not intentionally using grunt-concurrent. How can I confirm?

from grunt-cli.

paynecodes avatar paynecodes commented on May 27, 2024

Look in package.json. Also check in Gruntfile for 'concurrent'. My problems was the fact that I was using the --gruntfile argument while using a grunt plugin that didn't properly support passing those arguments around. See my issue sindresorhus/grunt-concurrent#17

Your issue doesn't seem to be the same because a downgrade worked for you, while that didn't work for me. But, just check to see if you are running any tasks that might have the same issue.

from grunt-cli.

pixelzoom avatar pixelzoom commented on May 27, 2024

Complete package.json was provided above. No 'concurrent' in Gruntfile.

from grunt-cli.

pixelzoom avatar pixelzoom commented on May 27, 2024

The only tasks I'm running in Gruntfile are these:

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

Running jshint first on all .js source files. Then running requirejs:build.

from grunt-cli.

paynecodes avatar paynecodes commented on May 27, 2024

Hmm... It's not grunt-concurrent then. I was able to find out it was grunt-concurrent because the Fatal error: Unable to find local grunt. logged just before my concurrent task ran. In other words, several of my tasks would run, then once it got to concurrent it would log out the fatal error. Similar for you? Or, is it simply logging out fatal error immediately?

from grunt-cli.

pixelzoom avatar pixelzoom commented on May 27, 2024

Mine is logging out fatal immediately, even when trying to do nothing but jshint.

from grunt-cli.

paynecodes avatar paynecodes commented on May 27, 2024

Oh wow.. Sorry, I couldn't help. First time using Grunt.

from grunt-cli.

pixelzoom avatar pixelzoom commented on May 27, 2024

Thanks for trying. We'll wait for the next release and keep our fingers crossed :)

from grunt-cli.

beninfobelt avatar beninfobelt commented on May 27, 2024

Am also experiencing an issue with Gruntfile.js. I am trying to clone a project from github then set up the bower dependencies and grunt build / dev tools.

After cloning the project, I run the bower command so that it reads through bower.json:

% bower install

Then I run the grunt commands:

% npm install -g grunt-cli
% npm install grunt --save-dev

Why is the Gruntfile.js not automatically created when I run these terminal commands?

It also hangs up on an issue related to livereload but that evaporates after I run these:

% npm install --save-dev connect-livereload
% npm install

When I start a project from scratch with these yeoman and grunt commands, it automatically creates the Gruntfile.js and I can successfully get the project to auto-load in the browser:

% npm install -g generator-angular
% yo angular
% bower install angular-ui
% npm install --save-dev connect-livereload
% npm install
% grunt test
% grunt server
% grunt

But I am trying to master the technique of cloning a project from github and then setting up the project locally. I would be very grateful for any direction you could provide. All the best,

Ben

from grunt-cli.

paynecodes avatar paynecodes commented on May 27, 2024

@beninfobelt Hmm... This seems like a bit of a mess with all the commands. I can't necessarily help you with the specifics, but have you tried going through the Yeoman Getting Started Guide?

@beninfobelt says:

When I start a project from scratch with these yeoman and grunt commands, it automatically creates the Gruntfile.js and I can successfully get the project to auto-load in the browser:

I would recommend you walk through it in a clean project directory like you did above.

Then, you can use Bower to install front-end dependencies, npm to install node dependencies that don't already come with Yeoaman (see package.json), and Grunt to compile and package your application.

@beninfobelt says:

But I am trying to master the technique of cloning a project from github and then setting up the project locally. I would be very grateful for any direction you could provide.

This isn't the proper place for the high-level direction you wish to have. If you post somewhere else, please feel free to post a link here, and I'll help you the best I know how.

from grunt-cli.

beninfobelt avatar beninfobelt commented on May 27, 2024

Hi - thanks for your guidance - I have posted here: http://stackoverflow.com/questions/18617214/setting-up-grunt-bower-angular-dev-tools-after-cloning-from-github

from grunt-cli.

vladikoff avatar vladikoff commented on May 27, 2024

@pixelzoom moving this issue to gruntjs/grunt#950
Please comment there if you still have this issue.
Thanks for your patience!

from grunt-cli.

cowboy avatar cowboy commented on May 27, 2024

You should now be able to use the --base option to specify the working directory from where Grunt should run. This is also where the CLI looks for the node_modules folder, where a locally-installed Grunt should live.

By default, if --base isn't used, the CLI looks in the folder the Gruntfile is in.

from grunt-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.