flow-typed

Flow-typed : UNCAUGHT ERROR: Error: Invalid npm libdef version! It appears to be a non-continugous range


I am getting following when trying to install flow-types

yarn run flow-typed install

Error

• Found 29 dependencies in package.json to install libdefs for. Searching...
• flow-typed cache not found, fetching from GitHub...
UNCAUGHT ERROR: Error: Invalid npm libdef version! It appears to be a non-continugous range.
    at pkgVersionMatch (/home/.../projectName/node_modules/flow-typed/dist/lib/npm/npmLibDefs.js:256:11)
    at /home/.../projectName/node_modules/flow-typed/dist/lib/npm/npmLibDefs.js:281:82
    at Array.filter (<anonymous>)
    at filterLibDefs (/home/.../projectName/node_modules/flow-typed/dist/lib/npm/npmLibDefs.js:275:15)
    at findNpmLibDef (/home/k.../projectName/node_modules/flow-typed/dist/lib/npm/npmLibDefs.js:329:27)
    at async /home/.../projectName/node_modules/flow-typed/dist/commands/install.js:273:20
    at async Promise.all (index 20)
    at async installNpmLibDefs (/home/.../projectName/node_modules/flow-typed/dist/commands/install.js:268:3)
    at async Object.run (/home/.../projectName/node_modules/flow-typed/dist/commands/install.js:149:27)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

What I tried?


Solution

  • The issue is caused by a loose dependency of flow-typed cli (semver) that broke the flow-typed installer. This has been fixed and we've since locked the version.

    To fix this issue update beyond v3.2.1 (to v3.3.0).

    Fix reference + explanation: https://github.com/flow-typed/flow-typed/pull/4018