yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.43k stars 2.72k forks source link

yarn install: Couldn't find package "package-name" on the "npm" registry #6029

Closed roytz closed 6 years ago

roytz commented 6 years ago

Please do not close this issue as duplicate - it's not the same as #3645 or #2611

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

What is the current behavior? Whenever executing yarn install I get an error message - Couldn't find package "[PACKAGE_NAME]" on the "npm" registry. After removing the PACKAGE_NAME line from the package.json dependencies, I get the same error for the next package on the list. I use yarn workspaces but the errors I get are for regular packages (such as winston, eslint etc.). Even after removing workspaces it still happens.

What is the expected behavior? Install all packages with no errors.

Please mention your node.js, yarn and operating system version. yarn: 1.7.0 node: 10.5.0 OS: macOS Sierra

yasin-herken commented 11 months ago

I deleted the yarn.lock file and reinstall it from scratch. It fixed

ahaverdings commented 6 months ago

Cost me a couple of days to find out that this error only happens for me when the version of the workspace (and dependant package) contains a version any other than a specfic semver. e.g. 1.0.1-SNAPSHOT.

So this fails: "version": "1.0.1-SNAPSHOT" This is succesful: "version": "1.0.1"

I think this might be a limitation with yarn workspace function that internally parses version numbers somewhere and fails causing the packages to be searched on npm which in turn also fails because it doesn't exist there.

might be related to: https://github.com/yarnpkg/yarn/issues/8567 I think upgrading semver dependency might go a long way

Alkhatri77 commented 6 months ago

Help my please

veryvorobey commented 4 months ago

In my case the problem was that the location of newly added package wasn't mentioned in "workspaces" property of package.json 🙂

"workspaces": [ "src/utils/newly-added-package" ],