1

我的项目具有以下结构:

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

当我运行时yarn flow出现以下错误

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;


但如果我运行, yarn flow-typed install express我会得到以下结果:

• 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/


有什么问题?

4

0 回答 0