question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flow-typed install crashes if you have a package installed from a git URL

See original GitHub issue

Here is the crash:

UNCAUGHT ERROR: Error: Malformed npm package name! Expected the name to be formatted as <PKGNAME>_v<MAJOR>.<MINOR>.<PATCH> but instead got mtwins
    at parsePkgNameVer (/Users/noah.allen/.config/yarn/global/node_modules/flow-typed/dist/lib/npm/npmLibDefs.js:295:11)
    at _callee6$ (/Users/noah.allen/.config/yarn/global/node_modules/flow-typed/dist/lib/npm/npmLibDefs.js:620:38)
    at tryCatch (/Users/noah.allen/.config/yarn/global/node_modules/regenerator-runtime/runtime.js:45:40)
    at Generator.invoke [as _invoke] (/Users/noah.allen/.config/yarn/global/node_modules/regenerator-runtime/runtime.js:271:22)
    at Generator.prototype.(anonymous function) [as next] (/Users/noah.allen/.config/yarn/global/node_modules/regenerator-runtime/runtime.js:97:21)
    at asyncGeneratorStep (/Users/noah.allen/.config/yarn/global/node_modules/flow-typed/dist/lib/npm/npmLibDefs.js:56:103)
    at _next (/Users/noah.allen/.config/yarn/global/node_modules/flow-typed/dist/lib/npm/npmLibDefs.js:58:194)
    at <anonymous>

As you can see, it got “mtwins” instead of what it was expecting. This matches a package I have linked through git: (note, I do have several more dependencies that I did not list here)

  "dependencies": {
    "lottie-react-native": "^2.6.1",
    "rn-tooltip": "git+https://github.com/mtwins/rn-tooltip.git"
  },

This happens when running:

  • flow-typed install lottie-react-native (a package I recently installed).
  • flow-typed install

To get around this, I have to:

  1. rm -rf flow-typed
  2. flow-typed install. This works successfully, unlike before deleting the folder

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:18
  • Comments:18 (13 by maintainers)

github_iconTop GitHub Comments

7reactions
bz2commented, Jun 4, 2019

This is regression the latest minor release - can work around by pinning to the previous version:

-    "flow-typed": "^2.5.1",
+    "flow-typed": "=2.5.1",
4reactions
pReyacommented, Nov 7, 2019

Still happens for me with 2.6.2 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Flow doesn't consider flow-typed's installed definitions
My project has the following structure: + src + index.js ` Server.js + node_modules + express + flow-typed + npm ` express_v4.x.x.js. When...
Read more >
flow-typed-with-use-cache-until - npm package - Snyk
flow-typed is a repository of third-party library interface definitions for use with Flow. You can grab definitions directly from this GitHub ...
Read more >
Introducing Flow-Typed - JavaScript. Flow
We 've built a simple CLI tool called flow-typed that helps to automate the process of finding, installing, and upgrading libdefs in your...
Read more >
Flow | Checking third-party code
It's always possible to write a libdef file yourself if you need to, ... Then, from within your project directory, run flow-typed install...
Read more >
eslint-plugin-flowtype - npm
Add plugins section and specify eslint-plugin-flowtype as a plugin. ... "as-needed" enforces no braces where they can be omitted.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found