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.

Incorrect selection of package version

See original GitHub issue

I have an eslint-config-myconfig package in a private registry having the following peer dependencies:

  "peerDependencies": {
    "@typescript-eslint/eslint-plugin": ">=2.21 <3",
    "@typescript-eslint/parser": ">=2.21 <3",
    "eslint": ">=6.8 <7",
    "eslint-config-airbnb-typescript": ">=7 <8",
    "eslint-config-prettier": ">=6.10 <7",
    "eslint-plugin-import": ">=2.20 <3",
    "eslint-plugin-prettier": ">=3.1 <4",
    "eslint-plugin-security": ">=1.4 <2",
    "prettier": ">=1.19 <2",
    "typescript": ">=3.8 <4"
  },

When I run install-peerdeps, I’m getting a “no matching version” error:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for typescript@3.8.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

It appears that install-peerdeps is not using the exact same semver expression when issuing the “npm install” command. So, instead of npm install typescript@">=3.8 <4", it’s just reading the first literal a.b.c number.

A quick debug shows the command being executed:

npm [
  'install',
  'eslint-config-insight@0.1.0',
  '@typescript-eslint/eslint-plugin@2.21.0',
  '@typescript-eslint/parser@2.21.0',
  'eslint@6.8.0',
  'eslint-config-airbnb-typescript@7.0.0',
  'eslint-config-prettier@6.10.0',
  'eslint-plugin-import@2.20.0',
  'eslint-plugin-prettier@3.1.0',
  'eslint-plugin-security@1.4.0',
  'prettier@1.19.0',
  'typescript@3.8.0',
  '--save-dev'
]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
ljharbcommented, Jul 6, 2020

I would expect the npm install command to be @^7 and not @7.0.0 or @7.4.0 - that seems like a bug.

0reactions
zhiqingchencommented, Nov 3, 2021

same problem on a Windows 11 machine

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip displays incorrect version of package - Stack Overflow
Suppose the package version that is misunderstood by pip is pandas . So that the behavior you observe is that: pip list --outdated....
Read more >
VS code shows incorrect latest version of a package ... - GitHub
I noticed recently that VS code doesn't show the correct latest version of some packages on hover in package.json file.
Read more >
Package operation failed due to incorrect version of Python
Package operation failed due to incorrect version of Python · Main error is "ValueError: /usr/bin/python does not match the python default version. It...
Read more >
Select upgrade of ONTAP 9 fails with error Package corrupted ...
Issue. ONTAP Select fails to process image packet with error (ImageManager) Package corrupted or incorrect-Version missing.
Read more >
Selective dependency resolutions - Yarn
Yarn supports selective version resolutions, which lets you define custom package versions or ranges inside your dependencies through the resolutions field ...
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