gruntjs / grunt-cli

Grunt's command line interface.
http://gruntjs.com/
MIT License
706 stars 248 forks source link

Can't have command-line argument "--module" in Node 12 #132

Open cakoose opened 4 years ago

cakoose commented 4 years ago

Some of my Grunt tasks take a "--module=..." argument. Under Node 8.15.0, things work fine:

$ grunt --hello=asdf 
Warning: Task "default" not found. Use --force to continue.

Aborted due to warnings.
$ grunt --module=asdf
Warning: Task "default" not found. Use --force to continue.

Under Node 10 and above, something goes wrong when I use "--module=...".

$ grunt --hello=asdf  
Warning: Task "default" not found. Use --force to continue.

Aborted due to warnings.
$ grunt --module=asdf
/Users/kannan/.nodenv/versions/10.17.0/bin/node: bad option: --module=asdf
sateffen commented 4 years ago

The problem can't be solved by grunt I guess, as --module is an option in node itself.

--module execute a file as a JavaScript module. Note: the --module option is implicitly enabled for *.mjs files.