gruntjs / grunt-cli Goto Github PK
View Code? Open in Web Editor NEWGrunt's command line interface.
Home Page: http://gruntjs.com/
License: MIT License
Grunt's command line interface.
Home Page: http://gruntjs.com/
License: MIT License
If there is no Gruntfile, this will display:
Fatal error: Unable to find Gruntfile. For help, visit http://gruntjs.com/
If there is a Gruntfile but a local grunt can't be found, this will display:
Fatal error: Unable to find local grunt. For help, visit http://gruntjs.com/
Either will display whether or not --help
is used. I think these messages need to be a little more explanatory.
I posted an identical issue to this one for npm.
process.title = "grunt";
overwrites the original title (of "Command Prompt", etc) thereby stripping away our ability to detect which shell is being used on Windows during tests.
process.title += " - grunt";
as node produces (in Windows), would be better.
On a project with a grunt.js
file from before the 0.4 upgrade (in this case an old branch of mine from jquery/jquery
) running grunt (/usr/local/bin/grunt -> ../lib/node_modules/grunt-cli/bin/grunt
) gives the following:
$ grunt
Fatal error: Object prototype may only be an Object or null
$ grunt --verbose
Initializing
Command-line options: --verbose
Reading "null" Gruntfile...ERROR
Fatal error: Object prototype may only be an Object or null
Being able to call a Gruntfile giving it as parameter instead of only autodiscover it. As a (implicit?) bonus, being able to launch the Gruntfile with a shell-bang.
I ran into this error when messing with the --completion
flag:
$ grunt --completion
echo "Specified grunt shell auto-completion rules not found."
Not sure why the error message says echo
. Looks like this is coming from /lib/completion.js#L25
Here's the output I get when I try to do an npm install -g grunt-cli
https://gist.github.com/robdodson/5794067
Same error can be found here (flatiron/flatiron#90).
Not sure what's up :\
$ npm i -g grunt-cli
npm http GET https://registry.npmjs.org/grunt-cli
npm http 200 https://registry.npmjs.org/grunt-cli
npm http GET https://registry.npmjs.org/grunt-cli/-/grunt-cli-0.1.9.tgz
npm http 200 https://registry.npmjs.org/grunt-cli/-/grunt-cli-0.1.9.tgz
npm http GET https://registry.npmjs.org/resolve
npm http GET https://registry.npmjs.org/findup-sync
npm http GET https://registry.npmjs.org/nopt
npm http 304 https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz
npm http 200 https://registry.npmjs.org/findup-sync
npm http GET https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.2.tgz
npm http 200 https://registry.npmjs.org/resolve
npm http GET https://registry.npmjs.org/resolve/-/resolve-0.3.1.tgz
npm http 200 https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz
npm http 200 https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.2.tgz
npm http 200 https://registry.npmjs.org/resolve/-/resolve-0.3.1.tgz
npm http GET https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/glob/-/glob-3.1.21.tgz
npm http 200 https://registry.npmjs.org/glob/-/glob-3.1.21.tgz
npm http 200 https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/lodash/-/lodash-1.0.1.tgz
npm http 200 https://registry.npmjs.org/lodash/-/lodash-1.0.1.tgz
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz
npm http 200 https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/sigmund
/usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt
npm ERR! Error: EMFILE, too many open files
npm ERR! at new Glob (/usr/local/lib/node_modules/npm/node_modules/glob/glob.js:105:21)
npm ERR! at glob (/usr/local/lib/node_modules/npm/node_modules/glob/glob.js:57:11)
npm ERR! at gypfile (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:133:17)
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:118:33
npm ERR! at Array.forEach (native)
npm ERR! at extras (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:117:21)
npm ERR! at parseJson (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:86:17)
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:58:33
npm ERR! at fs.js:266:14
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Darwin 12.4.1
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "i" "-g" "grunt-cli"
/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:266
log.error("cwd", process.cwd())
^
Error: EMFILE, too many open files
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:266:28)
at process.EventEmitter.emit (events.js:117:20)
at process._fatalException (node.js:272:26)
How can I tell what version of grunt-cli
I have installed?
I've tried this:
grunt-cli-v
-bash: grunt-cli: command not found
Also tried grunt-cli version
with no luck. Is there another way to do this? If not, how can I keep up with the latest version?
This is more of a question than a bug, but I'm wondering what's the right way to use grunt to run scripts via npm
(such as npm test
).
I'm assuming that ideally when I clone an npm project the following should "just work":
npm install && npm test
The problem is that this can fail because of undeclared/implied dependency on globally-installed grunt-cli
.
If package.json
defines:
"scripts": {"test": "grunt test"},
then it won't work if I don't have grunt-cli
installed globally, and there's no way to declare in npm
that grunt-cli
is a dev dependency for the package.
I'm not a grunt user and I'm finding packages that are broken this way because of missing grunt dependency.
I thought that the correct way to build npm packages that avoid "works on author's machine, but not others" type of problem is to use locally symlinked binaries:
"scripts": {"test": "./node_modules/.bin/grunt test"},
"dependencies": {"grunt-cli":…},
This way the package lists all of its dependencies and doesn't depend on out-of-bound information and separate manual installation of grunt-cli.
However, the documentation says grunt-cli doesn't support being installed locally.
I'm wondering whether you've considered the issue and have a reason to discourage self-contained packages and require installation of grunt-cli as a separate manual task.
I originally filed this request against the grunt project. I'm aware that it wasn't well-received over there, so I'm not expecting this to go very far, yet I persist...
I have a typical JavaScript project. I want to automate deployment and builds to as few steps as possible. Right now I have to:
It would be terrific if grunt could be configured to automatically run npm install
. This seems like something everyone does over and over again, and good tools are supposed to be efficient.
This would facilitate the easy use of grunt and grunt plugins, without the extra step (provided package.json is properly defined).
This can't really be done as a grunt plugin, because then it would need the developer to run npm update
which defeats the purpose of this request.
I can automate this myself in a Makefile, but then why bother even using grunt then?
npm install
npm install
I'm not sure when it would be best to run npm update
, maybe have a task option that lets the developer choose the frequency or something? This is less important for my needs than npm install
, but I thought I'd mention it for completeness.
With the task app:deploy
if you type grunt app:de
tab will complete it as grunt app:app:deploy
.
I have ran npm install -g grunt-cli
to download grunt which installs to \\Server\username$\Redirected\AppData\npm
I am using FireShell and it comes with a batch file which does the following
@echo off IF not exist node_modules (npm install) grunt
But I receive the following error
`module.js:340
throw err;
^
Error: Cannot find module '\Server\username$\Redirected\AppData\npm\AppData\npm\node_modules\grunt-cli'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3`
I am completely lost with what to do to get grunt to run successfully on my Windows Machine. My Environment Variable - Path is \\Server\username$\Redirected\AppData\npm
Would be good to create a devel branch that tracks grunt#devel, Just lost one hour figuring out I was running the grunt npm version rather than the one with latest changes.
Would be good. Because I'm applying a common trick, putting node_modules/.bin
into the global $PATH to avoid global installs. Many others do the same.
But since grunt places its bin in its own subfolder, the above trick isn't working anymore.
I'm running Ubuntu 14.04 on AWS and the grunt
command is failing, exiting with 1 but no output whatsoever.
I've attempted global install and local install to project with the same results on the latest version of npm, node and grunt.
Any ideas what this may be?
I'm creating a Node.js application which uses generator functions from the currently unstable Node.js 0.11.x branch. Also, my mocha-based unit tests are using generator functions, and if I run mocha by calling
$ mocha --harmony
everything is fine. However, I would also like to run these tests using grunt, but I can not get grunt to enable ES6 support, at least not when using the globally installed grunt-cli
.
Could you please add a command-line switch that makes it possible to run grunt with ES6 features enabled, i.e. something such as:
$ grunt --harmony
?
I added grunt-cli as dependency of my own web app, together with other grunt plugins.
(I want grunt-cli to be part (and version freezed) of the app repo).
But when I run it this way it fails because grunt can't be found, adding grunt dependency solves the problem.
I notice grunt is added as a devDependency of this module, shouldn't it be a regular dependency?
Or we just need to remember to always include grunt in our package.json if we include grunt-cli?
I ran into an issue while trying to get grunt v0.4.0rc7 working globally. I understand that best practice is to include grunt locally to a project, and normally do. But in this particular situation it makes more sense to install it globally.
The steps I have taken so far are as follows:
sudo npm install -g grunt-cli
sudo npm install -g [email protected]
I have a Gruntfile.js
in my project root with a basic test
task that just prints "Works!". When I run grunt test
it fails saying Fatal error: Unable to find local grunt.
. I took a look at node/bin/grunt
and logged the variable gruntpath
inside the exit callback and it is an empty string. Also the exit code is 11, not 0. But if I replace all the logic for loading the cli module like:
require(require.resolve("grunt")).cli();
Everything works fine.
So am I missing something? Is this just a fancy way of enforcing best practices and making people include grunt locally to a project?
With all processes closed, and just the terminal app open, if you start the grunt server for your application using grunt server and keep it running for some time there is significant heating on Mac OSX Mavericks. Also the battery life is substantially degraded. A 7-9 hour battery life is brought down to 3 hours with grunt server in running mode.
At the risk of looking like an idiot, I think current package.json
is missing main
section/variable.
The reason I believe this is, I can't get node.js+npm+grunt to get to work on Win 7 64 bit machine.
I can run npm install
from project dir and it works fine. I installed grunt-cli
using npm install -g grunt-cli
, it returned with 'Ok'. Of course, I did npm install grunt --save-dev
.
I cannot even do grunt --version
, which returns:
module.js:340
throw err;
^
Error: Cannot find module '%APPDATA%\npm\node_modules\grunt-cli'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
I can see the grunt-cli
correctly installed at said location.
I see that grunt-cli
's package.json has bin
- is node suppose to execute its value?
I'm running node.js v0.10.30 x64.
I am trying to run grunt but looks like it not installed correctly. I installed
npm install grunt-cli -g and I am part of administrator group. On running grunt, I am getting following error
grunt : The term 'grunt' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
- CategoryInfo : ObjectNotFound: (grunt:String) [], CommandNotFoundException
- FullyQualifiedErrorId : CommandNotFoundException
Hello, I'm trying to install grunt-cli for bootstrap. I already did sudo npm install -g grunt-cli
with no problems, but when I navigate to the bootstrap root directory and do sudo npm install
I get a checksum error on a package. I think the problem is the request
package. This is my screen output:
npm http 200 https://registry.npmjs.org/request/-/request-2.27.0.tgz npm ERR! Error: shasum check failed for /home/macsj200/tmp/npm-3511-ZoNDs303/1393873183092-0.06942965905182064/tmp.tgz npm ERR! Expected: ea82f7b100c733d1a42af76801e506105e2a80ec npm ERR! Actual: 5d9766d040ec8f3daf52c03b97b9db989574099f npm ERR! at /usr/local/lib/node_modules/npm/node_modules/sha/index.js:38:8 npm ERR! at ReadStream.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/sha/index.js:85:7) npm ERR! at ReadStream.EventEmitter.emit (events.js:125:20) npm ERR! at _stream_readable.js:896:16 npm ERR! at process._tickCallback (node.js:316:11) npm ERR! If you need help, you may report this log at: npm ERR! <http://github.com/isaacs/npm/issues> npm ERR! or email it to: npm ERR! <[email protected]> npm ERR! System Linux 3.2.0-59-generic npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" npm ERR! cwd /var/www/solar/bootstrap npm ERR! node -v v0.11.8-pre npm ERR! npm -v 1.3.11
What should I do?
Not sure if this is intended or not, but if I use an option with no value followed by another option, grunt seems to parse the value of the first option being the full text of the second option. Like so...
$grunt migrate --dryrun --rollback
Unfortunately grunt seems to parse the options like:
{dryrun: '--rollback'}
instead of:
{dryrun: true, rollback: true}
Is there a problem parsing multiple parameters when one option follows another with no value?
As a workaround, I can successfully run the task like the following:
$grunt migrate --dryrun=1 --rollback=1
Thanks guys!
--force, -f A way to force your way past warnings. Want a suggestion? Don't
use this option, fix your code.
Should be "passed", not "past".
That's all.
If I run the command
grunt --gruntfile="path/to/Gruntfile.js"
from a folder that is not where Grunt or a Gruntfile is located, a fatal error is automatically thrown.
The same thing happens with:
grunt --base="path/to/gruntfile/dir"
These should be able to be run without referencing Grunt.
https://gist.github.com/pavelbinar/f19b0a68bbef6b7524e9
Node.js: v0.10.26
Any idea how to fix it?
As a command line user, I like being able to define make-like dependency task trees with Grunt.
I used to be able to do this in my Gruntfile.js, but after upgrading my nvm to nvm v0.23.3, this on longer works. Attempts to execute jshint with grunt jshint
now fail with command not found
, due to grunt-cli failing to connect the NPM PATHs to the Node package binaries.
How can we get grunt-cli to automatically pull in NPM PATHs so that grunt-cli can once again run Node package binaries?
Hi all,
I'm trying to run "sudo npm install -g grunt-cli", and after a call "sudo npm install" but the installation never ends, it keep locked on :
npm http 200 https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/express/-/express-3.1.2.tgz
npm http 200 https://registry.npmjs.org/express/-/express-3.1.2.tgz
Is there actually a problem?
Atte,
I am getting the SSL Error. I am trying to install grunt-cli. I have attached the logs below. Please help. I have gone through similar issues. Have already tried following:
npm config set ca ""
npm config set registry http://registry.npmjs.org/
npm config set strict-ssl false
Nothing has helped.
Here are the logs:
sudo /usr/local/bin/npm install -g [email protected]
npm http GET https://registry.npmjs.org/grunt-cli/0.1.0
npm http GET https://registry.npmjs.org/grunt-cli/0.1.0
npm http GET https://registry.npmjs.org/grunt-cli/0.1.0
npm ERR! Error: SSL Error: CERT_UNTRUSTED
npm ERR! at ClientRequest. (/usr/local/lib/node_modules/npm/node_modules/request/main.js:525:26)
npm ERR! at ClientRequest.g (events.js:185:14)
npm ERR! at ClientRequest.EventEmitter.emit (events.js:88:17)
npm ERR! at HTTPParser.parserOnIncomingClient (http.js:1455:7)
npm ERR! at HTTPParser.parserOnHeadersComplete as onHeadersComplete
npm ERR! at CleartextStream.socketOnData (http.js:1366:20)
npm ERR! at CleartextStream.CryptoStream._push (tls.js:495:27)
npm ERR! at SecurePair.cycle (tls.js:849:20)
npm ERR! at EncryptedStream.CryptoStream.write (tls.js:230:13)
npm ERR! at Socket.ondata (stream.js:38:26)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]
❯ grunt init
grunt-cli: The grunt command line interface. (v0.1.13)
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
Shouldn't this just generate a Gruntfile for the user?
The same error is displayed with grunt help
and grunt --help
.
I understand that at some point, this functionality was removed from Grunt, but I cannot figure out why. The links are broken in the current docs.
It'd also be great if there was a CLI UI like Bower or Yeoman.
❯ bower help init
Usage:
bower init [<options>]
Options:
-h, --help Show this help message
Additionally all global options listed in 'bower help' are available
Description:
Creates a bower.json file based on answers to questions.
❯ yo
[?] What would you like to do? (Use arrow keys)
❯ Run the Angular generator (0.7.1)
Run the Bootstrap3-less generator (3.0.1)
Run the Pure generator (0.2.0)
Run the Static generator (0.0.8)
Run the Webapp generator (0.4.7)
Run the Zurb-foundation generator (0.3.5)
Run the Karma generator (0.6.0)
(Move up and down to reveal more choices)
Even further,
❯ grunt-init
Running "init" task
A valid init template name must be specified.
Available templates
(No templates found)
Templates that exist in the /Users/kevinsuttle/.grunt-init directory may be run
with "grunt-init TEMPLATE". Templates that exist in another location may be run
with "grunt-init /path/to/TEMPLATE". A template is a directory that must
contain, at the very minimum, a template.js file.
For more information, see http://gruntjs.com/project-scaffolding
This is an opportunity to do work on the user's behalf, not give them a chore.
I've installed yeoman following their instructions and was able to successfully create a project. However if I try running 'grunt' or 'grunt test' I get this error:
Fatal error: listen EADDRNOTAVAIL
'grunt server' also fails due to linting in Gruntfile.js
As a command line user, I want grunt-cli to disable terminal color codes when I pipe grunt commands to less
, etc.
To make a long story short, both grunt and grunt-cli have a grunt
bin. If both are installed locally, only one bin gets installed.
This isn't a problem when developing grunt, because we don't install grunt as a dependency of itself. And it's not a problem when grunt is installed globally, because then you can just run grunt
and it works.
That being said, just like there are different versions of grunt, there will eventually be different versions of grunt-cli, and it makes sense for us to support grunt-cli being installable locally. Which means that both grunt and grunt-cli will need to co-exist locally in a project.
This is not going to be a problem for grunt 0.5+ when grunt no longer contains a bin, but it's driving me crazy right now.
The solution I see is to completely remove the grunt
bin from within grunt itself. Which means that users will not get any kind of error message when installing grunt globally and running grunt
.
Is this ok? Not ok?
+1 if you think it makes sense to completely remove the grunt
bin script from within grunt.
I am posting this issue here as npm seems to be functioning fine, but when I attempt to install grunt-cli I get this error log. I tried adding sudo and also logging in as su with no luck.
info it worked if it ends with ok
verbose cli [ 'node', '/usr/bin/npm', 'install', '-g', 'grunt-cli' ]
info using [email protected]
info using [email protected]
verbose config file /home/local/.npmrc
verbose config file /usr/etc/npmrc
verbose config file /usr/share/npm/npmrc
silly exec /usr/bin/node "/usr/share/npm/bin/npm-get-uid-gid.js" "nobody" 1000
silly spawning [ '/usr/bin/node',
silly spawning [ '/usr/share/npm/bin/npm-get-uid-gid.js', 'nobody', 1000 ],
silly spawning null ]
silly output from getuid/gid {"uid":65534,"gid":1000}
silly output from getuid/gid
verbose cache add [ 'grunt-cli', null ]
silly cache add: name, spec, args [ undefined, 'grunt-cli', [ 'grunt-cli', null ] ]
verbose parsed url { pathname: 'grunt-cli', path: 'grunt-cli', href: 'grunt-cli' }
verbose addNamed [ 'grunt-cli', '' ]
verbose addNamed [ null, '' ]
silly name, range, hasData [ 'grunt-cli', '', false ]
verbose raw, before any munging grunt-cli
verbose url resolving [ 'https://registry.npmjs.org/', './grunt-cli' ]
verbose url resolved https://registry.npmjs.org/grunt-cli
http GET https://registry.npmjs.org/grunt-cli
ERR! Error: failed to fetch from registry: grunt-cli
ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
ERR! at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
ERR! at Request.emit (events.js:88:20)
ERR! at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12)
ERR! at ClientRequest.emit (events.js:67:17)
ERR! at HTTPParser.onIncoming (http.js:1261:11)
ERR! at HTTPParser.onHeadersComplete (http.js:102:31)
ERR! You may report this log at:
ERR! <http://bugs.debian.org/npm>
ERR! or use
ERR! reportbug --attach /var/www/html/symfony/npm-debug.log npm
ERR!
ERR! System Linux 3.8.0-29-generic
ERR! command "node" "/usr/bin/npm" "install" "-g" "grunt-cli"
ERR! cwd /var/www/html/symfony
ERR! node -v v0.6.12
ERR! npm -v 1.1.4
ERR! message failed to fetch from registry: grunt-cli
verbose exit [ 1, true ]
OSX 10.7
Node.js v0.10.24
When installing grunt-cli on my Mac I am getting the following errors (dependency unmet):
sudo npm install -g grunt-cli
npm http GET https://registry.npmjs.org/grunt-cli
npm http 304 https://registry.npmjs.org/grunt-cli
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/findup-sync
npm http GET https://registry.npmjs.org/resolve
npm http 304 https://registry.npmjs.org/findup-sync
npm http 304 https://registry.npmjs.org/resolve
npm http 304 https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/abbrev
npm http 304 https://registry.npmjs.org/glob
npm http 304 https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/minimatch
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 304 https://registry.npmjs.org/lru-cache
npm http 304 https://registry.npmjs.org/sigmund
/usr/local/share/npm/bin/grunt -> /usr/local/share/npm/lib/node_modules/grunt-cli/bin/grunt
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/yeoman/node_modules/bower requires colors@'latest' but will load
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/yeoman/node_modules/colors,
npm WARN unmet dependency which is version 0.6.0-1
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/yeoman/node_modules/bower requires rimraf@'latest' but will load
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/yeoman/node_modules/rimraf,
npm WARN unmet dependency which is version 2.0.2
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/yeoman/node_modules/bower requires mkdirp@'latest' but will load
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/yeoman/node_modules/mkdirp,
npm WARN unmet dependency which is version 0.3.4
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/yeoman/node_modules/bower requires fstream@'latest' but will load
npm WARN unmet dependency /usr/local/share/npm/lib/node_modules/yeoman/node_modules/fstream,
npm WARN unmet dependency which is version 0.1.19
[email protected] /usr/local/share/npm/lib/node_modules/grunt-cli
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected])
NT
I'm not sure this matters in the short term. I think for 0.4 we should detect calls to --help in bin/grunt when a local installation is not available. We could say something along the lines of "you need to install grunt locally to use it."
Long term (v0.5-0.6), I see grunt itself losing the ability to process the CLI and that moving here. When that happens, we can handle help properly, but I don't think we're ready for that kind of a change now.
Thoughts @sindresorhus, @shama, @jsoverson, @cowboy?
I'm using grunt version 0.4.1 and grunt-cli version 0.1.9. If I add this Gruntfile:
module.exports = function(grunt) {};
And I run grunt --tasks
, I get the following error:
path.js:360
throw new TypeError('Arguments to path.join must be strings');
^
TypeError: Arguments to path.join must be strings
at path.js:360:15
at Array.filter (native)
at Object.exports.join (path.js:358:36)
at Object.file.exists (/Users/landonschropp/Development/example/node_modules/grunt/lib/grunt/file.js:371:28)
at task.loadTasks (/Users/landonschropp/Development/example/node_modules/grunt/lib/grunt/task.js:358:18)
at Array.forEach (native)
at Task.task.init (/Users/landonschropp/Development/example/node_modules/grunt/lib/grunt/task.js:444:33)
at Object.grunt.tasks (/Users/landonschropp/Development/example/node_modules/grunt/lib/grunt.js:113:8)
at Object.module.exports [as cli] (/Users/landonschropp/Development/example/node_modules/grunt/lib/grunt/cli.js:38:9)
at Object.<anonymous> (/usr/local/lib/node_modules/grunt-cli/bin/grunt:41:20)
I need to install grunt-cli locally and did so according to the readme. This works most of the times, but in some cases the bin-folder is excluded from the installation, causing errors in my build. Problem is, I can't pin down where or why this goes wrong.. Are there any circumstances where node_modules/grunt-cli/bin/grunt
won't be installed?
It would be nice to know what's changed in the versions. I'm running 0.1.9 now and wondering what's in 0.1.11.
Normally, grunt-cli
works fine. It looks for '../node_modules/grunt'
relative to Gruntfile.js
per this code and all is good in the world.
The problem is that when developing grunt itself, grunt isn't at that path relative to the Gruntfile. It's at '../lib/grunt.js'
.
So, should we hard-code into grunt-cli
a check to see we're trying to grunt grunt itself? If so, is the existence of '../lib/grunt.js'
a good enough test?
This is actually breaking a travis build on the grunt 532
branch right now.
Pushing a fix in a branch shortly.
grunt-cli could play nicer with other CLI programs, e.g. being piped to less
, if it automatically used --no-color
when no TTY is detected.
I upgraded from grunt-cli 0.1.6 to 0.1.9, using 'npm install -g grunt-cli'
% npm --version
1.3.4
% grunt --version
grunt-cli v0.1.9
grunt v0.4.1
%
Our build process uses a Gruntfile.js that is shared by multiple projects, so we use the --gruntfile option when invoking grunt. Here's what happens after updating grunt-cli:
% grunt --gruntfile ../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
%
'npm ls' shows that I have a local grunt installed ([email protected]).
If I copy Gruntfile.js to the current directory and run 'grunt', everything is fine. This is part of a build process that has been working smoothly for quite some time, and we've made no changes to that build process other than to update grunt-cli.
Error: Cannot find module '%APPDATA%\Roaming\npm\node_modules\grunt-cli\bin\package.json'
Copy of grunt-cli\package.json to grunt-cli\bin\ solve issue
I think it is incorrect base path detection
Follow the tools like bower and npm getting command line completion working in zsh.
i wish i could issue a PR for this but I'm new to zsh and I consider this level of shell scripting to be voodoo magic.
For inspiration:
Bower completion code:
https://github.com/bower/bower/blob/master/templates/completion.mustache
NPM completion code:
https://github.com/isaacs/npm/blob/master/lib/completion.js
It would be a great deal of help if we could minimize the output of tasks by ignoring all grunt.log
calls - especially when it's used in deployment process.
Ideally, it would output only error messages, if any ( error code is given at the end, so no need for other output ).
does that make sense?
Does grunt-cli
have to be installed globally? Is there any reason against a local installation?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.