Comments (22)
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.
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.
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.
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.
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.
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.
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.
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.
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.
I'm not intentionally using grunt-concurrent. How can I confirm?
from grunt-cli.
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.
Complete package.json was provided above. No 'concurrent' in Gruntfile.
from grunt-cli.
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.
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.
Mine is logging out fatal immediately, even when trying to do nothing but jshint.
from grunt-cli.
Oh wow.. Sorry, I couldn't help. First time using Grunt.
from grunt-cli.
Thanks for trying. We'll wait for the next release and keep our fingers crossed :)
from grunt-cli.
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.
@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.
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.
@pixelzoom moving this issue to gruntjs/grunt#950
Please comment there if you still have this issue.
Thanks for your patience!
from grunt-cli.
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)
- Errors when installing grunt-cli with npm HOT 1
- Grunt crashing in Node.js v10 HOT 7
- grunt not working on nodejs v10.6.0 HOT 1
- CLI options cwd and require are not parsed correctly in v1.3.0 HOT 2
- can't run Gruntfile.js HOT 3
- bad option: --force on Node 10 HOT 3
- gruntfile option is part of grunt.option.flags()
- npm ERR! 409 Conflict: v8flags@~3.1.1 HOT 1
- high severity vulnerability HOT 2
- how to disable "tab auto run grunt-cli" on macOS
- Local Npm module "grunt-cli" not found. Is it installed?
- Can't have command-line argument "--module" in Node 12 HOT 1
- Brand new install, 2 deprecated messages (but on console error output)
- Security warning for liftoff dependency HOT 1
- Current doc says "typescript" needs to be installed for TypeScript support, but I believe `ts-node` required as well
- Global install of grunt-cli not working
- Unexpected Token issue with Magento 1 deploy HOT 3
- CVE
- "--report-directory" flag ignored by grunt-cli@~1.4.2
- Hi
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-cli.