Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'flow-node --use_strict <path>/jake/bin/cli.js' fails because of 'utilities' #347

Open
GezzMC opened this issue Mar 7, 2018 · 2 comments

Comments

@GezzMC
Copy link

GezzMC commented Mar 7, 2018

This is only a problem if you want it to be. Instead of --use_strict, I put "use strict"; in my jakefiles.

I explain what I'm doing, so you know some of what people are doing with Jake.

I'm using flow check to check my typing in Jakefiles, so that's how this comes about. Instead of running jakefiles with your .bin/jake.cmd, I use a command like this:

flow-node "<path to jake>/jake/bin/cli.js" -f foo_jakefile.js

Since I'm running things direct, I go ahead and try:

flow-node --use_strict <path to jake>/jake/bin/cli.js -f foo_jakefile.js

Errors start to crop up do to the utilities package. I started to hunt them down and make changes, but one problem is that there's more than one node_modules/utilities folder. So, I quit trying to fix things that way.

With flow check, it wants to resolve the use of functions desc and task in a Jakefile, so I import, like const jake = require("jake"), and then use jake.desc and jake.task.

That makes flow happy, but I still end up having to make exceptions for Jake, rather than run it like a normal Node module.

For example, I have a simple JS file that imports 20 or so modules, to test that they're in the right path. In that file, I can't do a const jake = require("jake") because my general node command is node --use_strict.

There's not a problem. But I have big plans for Jake, to do a lot of JavaScript in a Jake file, thus the reason for using Flow with Jake.

Thanks.

@mde
Copy link
Contributor

mde commented Apr 2, 2018

Is this an issue with the utilities module? Might be worth updating utilities to work better with strict mode.

@GezzMC
Copy link
Author

GezzMC commented Apr 3, 2018

Thanks for the reply.

I suppose utilities is one of the culprits that prevents the use of --use_strict, but I don't do global installs of modules, or tweak the default downloads of dependencies. I let different packages download whatever packages they specify.

My general mode of operation is to figure out how to use a package as is without doing any mods, such as fixing dependencies. There could be other packages that also don't work with --use_strict.

How it is is okay with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants