Flow and node.js
Necessary piece of configuration
To use flow in node application first one needs to install it and run init:
$ npm install -g flow-bin
$ flow init
Next step is less intuitive. Flow, by default doesn’t look into node_modules
for finding code. Also it ignores NODE_PATH
environment settings. That causes problem when the project uses custom one. Both of those can be easily fixed by modifying .flowconfig
. Following lines will add both node_modules
and lib
to search path for the flow
.
[options]
module.system.node.resolve_dirname=lib
module.system.node.resolve_dirname=node_modules
The above example was found in this commit.