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.

npm ERR! notarget No matching version found for statuses@^2.0.0 when npm install

See original GitHub issue

Describe the bug

Running npm install msw --save-dev on Windows 10 produces the following error:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for statuses@^2.0.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.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'msw'
npm ERR! notarget

Environment

  • nodejs: v14.16.0
  • npm: 6.14.11

To Reproduce

Steps to reproduce the behavior:

  1. Run npm install msw --save-dev
  2. See error

Expected behavior

msw is successfully installed

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
kettanaitocommented, May 12, 2021

It looks like you have a custom NPM registry configured. I suspect that to be a culprit in some way.

I may suggest setting the default registry and trying to install MSW:

// .npmrc
-registry=https://myproject.com/_packaging/tps/npm/registry
+registry=https://registry.npmjs.org/

We need to take the custom registry out to effectively triage if it’s the reason.

The statuses package is correctly specified as MSW’s dependency, including its range version that’s published to NPM. The issue is likely on your side with the custom registry you’re using. Check how it works, any sorts of whitelists and permissions. I’m afraid I don’t see an issue on the library’s side to fix.

0reactions
ayohanacommented, May 11, 2021

@kettanaito I ran npm config list and below is the response. Can you help double check this for me?

A little more background on my project. It is in React/Typescript, and I use Visual Studio for development.

Thank you for your help!

; cli configs
metrics-registry = "https://myproject.com/_packaging/tps/npm/registry"
scope = ""
user-agent = "npm/6.14.11 node/v14.16.0 win32 x64"

; project config C:\Users\...\source\repos\myproject\.npmrc
@myproject:always-auth = true
@myproject:registry = "https://myproject.com/_packaging/csc/npm/registry/"
always-auth = true
registry = "https://myproject.com/_packaging/tps/npm/registry"

; userconfig C:\Users\...\.npmrc
//myproject.com/_packaging/csc/npm/registry/:email = "not-used@example.com"
//myproject.com/_packaging/csc/npm/registry/:username = "VssSessionToken"
//myproject.com/_packaging/tps/npm/:email = "not-used@example.com"
//myproject.com/_packaging/tps/npm/:username = "VssSessionToken"
always-auth = true
cache = "c:\\npm-cache"
msvs_version = "2015"

; builtin config undefined
prefix = "C:\\Users\\...\\AppData\\Roaming\\npm"

; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\Users\...\source\repos\myproject
; HOME = C:\Users\...
; "npm config ls -l" to show all defaults.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Npm Error - No matching version found for - Stack Overflow
Try removing package-lock.json and running npm install && npm update , it'll install the latest version and clear all errors.
Read more >
Can't install with NPM (No matching version found for @nlpjs ...
So I guess that is a new bug. Describe the bug. When I try to install library takes this error: $ npm i...
Read more >
No matching version found for [Error LoopBack Solved]
npm WARN config cache-min This option has been deprecated in favor of '--prefer-offline'. npm ERR ! code ETARGET npm ERR ! notarget No...
Read more >
Npm "No matching version found" - Nexus Repository Manager
Once again, I am getting an error when I attempt install an npm package with NXRM npm-group that is configured as registry in...
Read more >
How to fix npm ERR! code ETARGET issue - Nathan Sebhastian
The error ETARGET means that npm can't find a package version that matches your requirements as defined in the package.json file. In the...
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