'How to debug "No matching version found for [email protected]" error while installing npm dependencies?
As seen from npm error log - reason for this error is bug, found inside colors package with version 1.4.1. So, now latest available version is 1.4.0, but this package isn't requested directly in my package.json - "colors" is a dependency of dependency. I think, there are three ways to resolve this problem:
- Wait until bug inside "colors" package will be fixed and version 1.4.1 will come back
- Find dependency, which requires [email protected] and downgrade it version
- Use "overrides" property of package.json to replace version of "colors" package in all nested dependecies (not working)
package-lock.json contains 8 dependecies, which requires "colors" package with versions "1.4.0" and "^1.1.2" and one misterious record, which was in one scope with dependencies, listed in package.json in one of my workspaces:
"colors": {
"version": "1.4.1",
"dev": true
},
But at the same time "colors" dependency not exists in my package.json
Is there any ideas how to find dependency, which requires "[email protected]" in package.json, given that the npm error log does not provide the necessary information about where the "colors" package was requested?
Or maybe any ideas how to resolve this problem?
P. S. npm cache clean --force not solves the problem
Solution 1:[1]
I have just tried an npm i on an old project and I have the same issue(except mine is looking for version 1.4.2 of colors). I am not referencing colors directly either, so some other package must be using it and I can't see which by viewing the package-lock.json.
As far as I know, the developer of colors said "start to donate or no more updates", so there never will be a version >=1.4.1.
Solution 2:[2]
So I encountered this issue today and tried yarn and npm package managers. Both ended with the same error listed above. I don't use the package in the project directly, so didn't know where to find it.
npm website as most people will know the latest version is 1.4.0 and there will most likely won't be a 1.4.1!
Solution:
npm i colors
Install in your project should appear in your package.json. Worked for me!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dharman |
| Solution 2 | psquizzle |

