Flow doesn't consider flow-typed's installed definitions

73 views Asked by At

My project has the following structure:

+ src
   + index.js
   ` Server.js
+ node_modules
   + express
+ flow-typed
   + npm
      ` express_v4.x.x.js

When I run yarn flow I get the following error

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/Server.js:2:26

Cannot resolve module express. [cannot-resolve-module]

     1│ // @flow
     2│ import * as express from "express";
     3│
     4│ export class Server {
     5│     #express: $Request;


but if I run yarn flow-typed install express I get the following result:

• Searching for 1 libdefs...
• rebasing flow-typed cache...
• Installing 1 libDefs...
  • flow-typed/npm/express_v4.x.x.js already exists and appears to have been manually written or changed!
    Consider contributing your changes back to flow-typed repository :)
    Read more at https://github.com/flowtype/flow-typed/wiki/Contributing-Library-Definitions
    └> Use --overwrite to overwrite the existing libdef.
• The following installed libdefs are compatible with your dependencies, but may not include all minor and patch changes for your specific dependency version:

  • libdef: express_v4.x.x (satisfies express@^4.17.1)

  Consider submitting a versioned update for this package to 
  https://github.com/flowtype/flow-typed/


What could be wrong?

0

There are 0 answers