Skip to content

ESLint Initialization Results in "TypeError: Invalid Version: undefined" #13978

@jasel-lewis

Description

@jasel-lewis

When initializing ESLint, receiving a TypeError in relation to sermver.

Environment:
Node v14.15.3
npm v6.14.9

Repro:

  1. npx create-electron-app my-app
  2. npm install eslint --save-dev
  3. ./node_modules/.bin/eslint --init

Config selections:

  • To check syntax, find problems, and enforce code style
  • JavaScript modules (import/export)
  • React
  • Does your project use TypeScript: No
  • Where does your code run? Browser
  • Use a popular style guide
  • Standard: https://github.com/standard/standard
  • What format do you want your config file to be in? JavaScript

Results:

Checking peerDependencies of eslint-config-standard@latest

Oops! Something went wrong! :(

ESLint: 7.10.0

TypeError: Invalid Version: undefined
    at new SemVer (D:\Repos.Private\my-app\node_modules\semver\classes\semver.js:19:13)
    at outside (D:\Repos.Private\my-app\node_modules\semver\ranges\outside.js:12:13)
    at Object.ltr (D:\Repos.Private\my-app\node_modules\semver\ranges\ltr.js:3:42)
    at TogglePrompt.message (D:\Repos.Private\my-app\node_modules\eslint\lib\init\config-initializer.js:569:37)
    at Object.exports.resolve (D:\Repos.Private\my-app\node_modules\enquirer\lib\utils.js:43:18)
    at TogglePrompt.resolve (D:\Repos.Private\my-app\node_modules\enquirer\lib\prompt.js:373:18)
    at TogglePrompt.element (D:\Repos.Private\my-app\node_modules\enquirer\lib\prompt.js:249:26)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async TogglePrompt.message (D:\Repos.Private\my-app\node_modules\enquirer\lib\prompt.js:270:19)
    at async TogglePrompt.render (D:\Repos.Private\my-app\node_modules\enquirer\lib\prompts\toggle.js:91:19)

Possibly similar in relation to "Invalid Version: undefined" semver on version 3.x flow-typed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlycliRelates to ESLint's command-line interface

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions