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.

yup npm package throws "Invalid Version: undefined" error

See original GitHub issue

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

When you have the yup package as a dependency, ie:

"dependencies": {
    "yup": "0.28.5"
}

And then you run flow-typed install --ignoreDeps dev, flow-typed crashes with:

• Found 1 dependencies in package.json to install libdefs for. Searching...
• rebasing flow-typed cache...
UNCAUGHT ERROR: TypeError: Invalid Version: undefined
    at new SemVer (/Users/evhaus/Git/myapp/node_modules/flow-typed/node_modules/semver/classes/semver.js:22:13)
    at compare (/Users/evhaus/Git/myapp/node_modules/flow-typed/node_modules/semver/functions/compare.js:3:3)
    at Object.lt (/Users/evhaus/Git/myapp/node_modules/flow-typed/node_modules/semver/functions/lt.js:2:29)
    at Promise.all.libDefsToSearchForEntries.map (/Users/evhaus/Git/myapp/node_modules/flow-typed/dist/commands/install.js:287:28)
error Command failed with exit code 1.

If the current behavior is a bug, please provide the steps to reproduce.

Reproducible with a tiny package.json:

{
	"name": "test",
	"dependencies": {
		"yup": "0.28.5"
	},
	"devDependencies": {
		"flow-bin": "0.124.0",
		"flow-typed": "3.1.0"
	}
}

Then install via npm install and then run npx flow-typed install --ignoreDeps dev.

What is the expected behavior?

Libdefs should be installed, or ignored. But not a hard crash.

Local Environment Information

  System:
    OS: macOS 10.15.4
    CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
    Memory: 295.04 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.17.0 - ~/.nvm/versions/node/v10.17.0/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v10.17.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    Homebrew: 2.2.16 - /usr/local/bin/brew
    pip3: 20.0.2 - /usr/local/bin/pip3
    RubyGems: 3.0.3 - /usr/bin/gem
  Utilities:
    Make: 3.81 - /usr/bin/make
    GCC: 4.2.1 - /usr/bin/gcc
    Git: 2.26.2 - /usr/local/bin/git
    Clang: 1103.0.32.59 - /usr/bin/clang
    Subversion: 1.10.4 - /usr/bin/svn
  Servers:
    Apache: 2.4.41 - /usr/sbin/apachectl
  Virtualization:
    Docker: 19.03.8 - /usr/local/bin/docker
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
  IDEs:
    Atom: 1.47.0-beta0
    Nano: 2.0.6 - /usr/bin/nano
    VSCode: 1.44.2 - /usr/local/bin/code
    Vim: 8.1 - /usr/bin/vim
    Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
  Languages:
    Bash: 3.2.57 - /bin/bash
    Go: 1.14.2 - /usr/local/bin/go
    Perl: 5.18.4 - /usr/bin/perl
    PHP: 7.3.11 - /usr/bin/php
    Python: 2.7.16 - /usr/bin/python
    Python3: 3.7.7 - /usr/local/bin/python3
    Ruby: 2.6.3 - /usr/bin/ruby
  Databases:
    PostgreSQL: 12.2 - /usr/local/bin/postgres
    SQLite: 3.28.0 - /usr/bin/sqlite3
  Browsers:
    Chrome: 81.0.4044.138
    Chrome Canary: 84.0.4144.2
    Firefox: 76.0
    Safari: 13.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
EvHauscommented, Aug 6, 2020

Confirmed. My issue is now resolved (using flow-typed@3.2.1).

1reaction
osmestadcommented, May 28, 2020

I’m seeing the same error, I have not isolated which dependencies it fails on here, but the console output I get is:

$ yarn flow-typed update --skip
$ /Users/osmestad/Code/wimp-web-client/node_modules/.bin/flow-typed update --skip
• Found 4 dependencies in package.json to install libdefs for. Searching...
• rebasing flow-typed cache...
UNCAUGHT ERROR: TypeError: Invalid Version: undefined
    at new SemVer (/Users/osmestad/Code/wimp-web-client/node_modules/flow-typed/node_modules/semver/classes/semver.js:22:13)
    at compare (/Users/osmestad/Code/wimp-web-client/node_modules/flow-typed/node_modules/semver/functions/compare.js:3:3)
    at Object.lt (/Users/osmestad/Code/wimp-web-client/node_modules/flow-typed/node_modules/semver/functions/lt.js:2:29)
    at /Users/osmestad/Code/wimp-web-client/node_modules/flow-typed/dist/commands/install.js:287:28
    at async Promise.all (index 2)
    at async installNpmLibDefs (/Users/osmestad/Code/wimp-web-client/node_modules/flow-typed/dist/commands/install.js:268:3)
    at async Object.run (/Users/osmestad/Code/wimp-web-client/node_modules/flow-typed/dist/commands/install.js:149:27)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Yup - npm
Yup is a JavaScript schema builder for value parsing and validation. Define a schema, transform a value to match, validate the shape of...
Read more >
npm install fails "invalid version" - Stack Overflow
I was using 1.0 as the version which was giving me an error. Changing it to 1.0.0 worked. Thanks! – Rizwan Javaid. Sep...
Read more >
yup - npm Package Health Analysis - Snyk
An important project maintenance signal to consider for yup is that it hasn't seen any new versions released to npm in the past...
Read more >
yup - npm.io
Require a value for the schema. All field values apart from undefined meet this requirement. mixed.typeError(message: string): Schema. Define an error message ...
Read more >
Error Messages | Cypress Documentation
Support File Errors. Support file missing or invalid. The supportFolder option was removed from Cypress in version 0.18.0 and was replaced by module...
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