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
@roytz are u by chance having any network issues (Firewall, etc)? Or, do you have a different registry set for any of your .yarnrc
or .npmrc
files?
Can you run the same command and include the --verbose
flag, then post the log here?
@hulkish thank you!!!
I wasn't aware that the configuration file might cause the problem. I wasted so much time on that...
Thanks again!
I'm facing this issue. Here is the verbose output:
yarn install v1.12.3
verbose 0.438 Checking for configuration file "~/lib/modules/immer/.npmrc".
verbose 0.438 Found configuration file "~/lib/modules/immer/.npmrc".
verbose 0.439 Checking for configuration file "~/.npmrc".
verbose 0.439 Found configuration file "~/.npmrc".
verbose 0.439 Checking for configuration file "~/.nvm/versions/node/v11.1.0/etc/npmrc".
verbose 0.44 Checking for configuration file "~/lib/modules/immer/.npmrc".
verbose 0.44 Found configuration file "~/lib/modules/immer/.npmrc".
verbose 0.44 Checking for configuration file "~/lib/modules/.npmrc".
verbose 0.44 Checking for configuration file "~/lib/.npmrc".
verbose 0.441 Checking for configuration file "~/.npmrc".
verbose 0.441 Found configuration file "~/.npmrc".
verbose 0.442 Checking for configuration file "/Users/.npmrc".
verbose 0.444 Checking for configuration file "~/lib/modules/immer/.yarnrc".
verbose 0.445 Checking for configuration file "~/.yarnrc".
verbose 0.445 Found configuration file "~/.yarnrc".
verbose 0.445 Checking for configuration file "~/.nvm/versions/node/v11.1.0/etc/yarnrc".
verbose 0.446 Checking for configuration file "~/lib/modules/immer/.yarnrc".
verbose 0.446 Checking for configuration file "~/lib/modules/.yarnrc".
verbose 0.446 Checking for configuration file "~/lib/.yarnrc".
verbose 0.446 Checking for configuration file "~/.yarnrc".
verbose 0.446 Found configuration file "~/.yarnrc".
verbose 0.447 Checking for configuration file "/Users/.yarnrc".
verbose 0.451 current time: 2018-11-28T15:15:05.417Z
info No lockfile found.
[1/4] 馃攳 Resolving packages...
verbose 0.525 Performing "GET" request to "https://registry.yarnpkg.com/@types%2fjest".
verbose 0.682 Request "https://registry.yarnpkg.com/@types%2fjest" finished with status code 401.
verbose 0.695 Error: Couldn't find package "@types/jest" on the "npm" registry.
at MessageError.ExtendableBuiltin (~/.nvm/versions/node/v11.1.0/pnpm-global/1/node_modules/.registry.npmjs.org/yarn/1.12.3/node_modules/yarn/lib/cli.js:727:66)
at new MessageError (~/.nvm/versions/node/v11.1.0/pnpm-global/1/node_modules/.registry.npmjs.org/yarn/1.12.3/node_modules/yarn/lib/cli.js:756:123)
at NpmResolver.<anonymous> (~/.nvm/versions/node/v11.1.0/pnpm-global/1/node_modules/.registry.npmjs.org/yarn/1.12.3/node_modules/yarn/lib/cli.js:49829:15)
at Generator.next (<anonymous>)
at step (~/.nvm/versions/node/v11.1.0/pnpm-global/1/node_modules/.registry.npmjs.org/yarn/1.12.3/node_modules/yarn/lib/cli.js:304:30)
at ~/.nvm/versions/node/v11.1.0/pnpm-global/1/node_modules/.registry.npmjs.org/yarn/1.12.3/node_modules/yarn/lib/cli.js:315:13
at process.internalTickCallback (internal/process/next_tick.js:77:7)
error Couldn't find package "@types/jest" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Nothing in the found .npmrc
and .yarnrc
files looks suspicious.
I can visit the URL that responded with status code 401, and there doesn't seem to an issue there.
Installing with npm install @types/jest -D
works fine.
yarn cache clean
does not help.yarn
with Homebrew does not help.yarn
with sudo
does not help.
Using yarn --registry https://registry.npmjs.org
worked.
edit: Using yarn --registry https://registry.yarnpkg.com
fails with the same error as my previous comment.
Hmm..
Moving my .npmrc file to my desktop temporarily worked for me.
I was trying to install @pusher/chatkit-client and the error above was being given to me. This is after 2 years of not having done anything to my .npmrc. The contents of that file were:
//registry.npmjs.org/:_authToken=SOME_AUTH_TOKEN
init.author.name=MY_NAME
Not sure what the issue was.
I just randomly had the exact same issue as @alvincrespo and clearing the random line out of .npmrc
fixed it for me. Lol, most random issue ever.
I was able to solve this error by running npm login
and logging in again.
Ran into this issue a few minutes ago. Can confirm that it was my .npmrc
. I renamed it and everything works now. Wonder what's going on? I haven't touched that file for more than a year.
I've started getting these errors too. When I removed the line from my .npmrc file with an auth token for the main npm registry that looked like a UUID (separated by dashes), then it worked.
What's strange is that the other auth tokens were not of this format - they look as if they are some base64-encoded string.
The //registry.npmjs.org/:_authToken=
part is generated by npm login
. See here
What's weird is that npm install
works fine, while yarn
chokes.
edit: More accurately, https://registry.yarnpkg.com
is the one choking, since doing..
yarn --registry https://registry.npmjs.org
..also works as expected.
@aleclarson note that yarn --registry https://registry.npmjs.org
did not solve the issue for me.
@eurycea that blog post fully explains it for my case
considering i can see this error with and without a npmrc....and, when i do have one its pointed to a private registry... i highly doubt that this is the cause.
Thanks @aleclarson yarn --registry https://registry.npmjs.org
also worked for me..
My experience is slightly different and it may help others
I had updated ~/.npmrc
to team domain and team domain only,
so it was missing https://registry.npmjs.org
if we put it back, it will work
In my case, it was because of ~/.npmrc file which defines another registry (used for enterprise environment and not accessible anymore). When I removed that configuration it worked fine.
in my case, it is totally new project and i am trying to install webpack. which gives me
$ yarn add webpack webpack-cli -DE
yarn add v1.15.2
info No lockfile found.
[1/4] 馃攳 Resolving packages...
error Couldn't find package "p-is-promise@^2.0.0" required by "mem@^4.0.0" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
MacOS Catalina
node:8
yarn 1.15.2
Trying to upgrade yarn to latest to check if happens again
I encountered this situation today. I resolved it by simply using the Yarn cache:
yarn --prefer-offline
The same problem today:
error Couldn't find package "2-thenable@^1.0.0" required by "stream-promise@^3.2.0" on the "npm" registry.
"npm i" works, but "yarn" - doesn't work
I have the same problem with 2-thenable
trying to install serverless
. It is missing from https://registry.yarnpkg.com
. I tried to search some way to report these issues but couldn't find it so adding to this thread.
Relevant output from --verbose
verbose 1.176 Performing "GET" request to "https://registry.yarnpkg.com/2-thenable".
verbose 1.218 Request "https://registry.yarnpkg.com/2-thenable" finished with status code 404.
verbose 1.403 Error: Couldn't find package "2-thenable@^1.0.0" required by "stream-promise@^3.2.0" on the "npm" registry.
I assume yarnpkg caches 404's for a period but this has now been happening for about 12 hours.
I have the same problem with
2-thenable
trying to installserverless
....
I wonder if the problem that suddenly appeared today is related to package names starting with a numeral. This started happening to me this morning with the package 3d-view
(published years ago). Requesting via web browser works as does npm install
. No .npmrc
or .yarnrc
files present in project. Tried npm login
to no avail. Tried --registry https://registry.npmjs.org
without improvement. Using --prefer-offline
works around the problem for now but only since the package happens to be cached on my machine from a previous time.
I am hoping that this is a transient problem related to yarn infrastructure or something and will just go away soon....
Version info
yarn version: 1.21.1
OS: Linux x64
node version: v12.14.1
npm version: 6.13.4
Output
verbose 2.978862289 Performing "GET" request to "https://registry.npmjs.org/3d-view".
verbose 3.028520022 Request "https://registry.npmjs.org/3d-view" finished with status code 404.
verbose 3.035182478 Error: https://registry.npmjs.org/3d-view: Not found
at Request.params.callback [as _callback] (/usr/share/yarn/lib/cli.js:66947:18)
at Request.self.callback (/usr/share/yarn/lib/cli.js:140665:22)
at Request.emit (events.js:223:5)
at Request.<anonymous> (/usr/share/yarn/lib/cli.js:141637:10)
at Request.emit (events.js:223:5)
at IncomingMessage.<anonymous> (/usr/share/yarn/lib/cli.js:141559:12)
at Object.onceWrapper (events.js:312:28)
at IncomingMessage.emit (events.js:228:7)
at endReadableNT (_stream_readable.js:1185:12)
at processTicksAndRejections (internal/process/task_queues.js:81:21)
error An unexpected error occurred: "https://registry.npmjs.org/3d-view: Not found".
Same problem for me with this
error Couldn't find package "7zip-bin@~5.0.3" required by "[email protected]" on the "npm" registry.
so with a number first too like @jacobq
I think we've documented all we need on this thread. It seems that several other issues are being opened for this bug:
Check if you have an other .npmrc or .yarnrc defined in your root folders or other folders. 'yarn install' might override the project configs to use the other config. It worked for me when I cleared out other .npmrc/.yarnrc files.
I am using a nexus private repository and saw in the debug logs that yarn tries to download
https://nexus.example.com/repository/npm-group/@paralleldrive%2freact-feature-toggles
with which the nexus responds with 404, because it should be
https://nexus.example.com/repository/npm-group/@paralleldrive/react-feature-toggles
i.e. the slash which gets url-encoded is the problem. id say that this is a problem with nexus not properly handling urls, but is it possible to turn yarns url-encoding off?
edit:
This problem is known and a solution is documented here:
https://issues.sonatype.org/browse/NEXUS-19709
I am facing the same issue.
Here is the --verbose log
PS C:\supportserviceUI2\support-service-ui> yarn --verbose
yarn install v1.19.2
verbose 0.4009734 Checking for configuration file "C:\supportserviceUI2\support-service-ui\.npmrc".
verbose 0.403072 Found configuration file "C:\supportserviceUI2\support-service-ui\.npmrc".
verbose 0.404912799 Checking for configuration file "C:\Users\r.sanjay.chaudhari\.npmrc".
verbose 0.4064841 Checking for configuration file "C:\Program Files\nodejs\etc\npmrc".
verbose 0.4078404 Checking for configuration file "C:\supportserviceUI2\support-service-ui\.npmrc".
verbose 0.4089847 Found configuration file "C:\supportserviceUI2\support-service-ui\.npmrc".
verbose 0.4105523 Checking for configuration file "C:\supportserviceUI2\.npmrc".
verbose 0.4179336 Checking for configuration file "C:\supportserviceUI2\support-service-ui\.yarnrc".
verbose 0.43528 Checking for configuration file "C:\Users\r.sanjay.chaudhari\.yarnrc".
verbose 0.438289299 Found configuration file "C:\Users\r.sanjay.chaudhari\.yarnrc".
verbose 0.4439843 Checking for configuration file "C:\Program Files\nodejs\etc\yarnrc".
verbose 0.4641203 Checking for configuration file "C:\supportserviceUI2\support-service-ui\.yarnrc".
verbose 0.483050699 Checking for configuration file "C:\supportserviceUI2\.yarnrc".
verbose 0.509881299 current time: 2020-07-31T13:01:26.161Z
verbose 0.747530899 Performing "GET" request to "https://yarnpkg.com/latest-version".
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
warning Resolution field "[email protected]" is incompatible with requested version "nodemon@^2.0.2"
warning Resolution field "[email protected]" is incompatible with requested version "mkdirp@^1.0.3"
verbose 1.5052446 Performing "GET" request to "http://mavencentral.it.abc.com:8081/nexus/repository/npm-idp/@idp%2fbusiness-features".
verbose 2.3941144 Request "http://mavencentral.it.abc.com:8081/nexus/repository/npm-idp/@idp%2fbusiness-features" finished with status code 404.
verbose 2.4090686 Error: Couldn't find package "@idp/business-features" on the "npm" registry.
at MessageError.ExtendableBuiltin (C:\Program Files (x86)\Yarn\lib\cli.js:721:66)
at new MessageError (C:\Program Files (x86)\Yarn\lib\cli.js:750:123)
at NpmResolver.
at Generator.next (
at step (C:\Program Files (x86)\Yarn\lib\cli.js:304:30)
at C:\Program Files (x86)\Yarn\lib\cli.js:315:13
at processTicksAndRejections (internal/process/task_queues.js:97:5)
error Couldn't find package "@idp/business-features" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
info There appears to be trouble with your network connection. Retrying...
verbose 5.4384625 Performing "GET" request to "https://yarnpkg.com/latest-version".
info There appears to be trouble with your network connection. Retrying...
verbose 9.507949699 Performing "GET" request to "https://yarnpkg.com/latest-version".
info There appears to be trouble with your network connection. Retrying...
verbose 13.5569681 Performing "GET" request to "https://yarnpkg.com/latest-version".
info There appears to be trouble with your network connection. Retrying...
verbose 17.300063699 Performing "GET" request to "https://yarnpkg.com/latest-version".
I was able to solve this error by running
npm login
and logging in again.
You sir, are a legend!
I've had this error happen so many times and it always seems to sort itself out a few hours later.
I just simply registered on the npm website and logged in with the command and tried to reinstall, all working now!
I was able to solve this error by running
npm login
and logging in again.You sir, are a legend!
I've had this error happen so many times and it always seems to sort itself out a few hours later.
I just simply registered on the npm website and logged in with the command and tried to reinstall, all working now!
i confirm, this solution work, you save my day
https://status.npmjs.org/incidents/cksjqc1w11v5 this is some npm registry issue
Experiencing it without any reason today (all jenkins pipelines failing, yarn install also failing locally). Nothing from the provided responses did help. Any ideas how to fix it?
verbose 15.803 Request "https://registry.npmjs.org/@redux-saga%2fcore" finished with status code 404.
verbose 15.815 Error: Couldn't find package "@redux-saga/core@^1.0.0" required by "[email protected]" on the "npm" registry.
npm login was temporary workaround but seems like npm registry is fixed now and errors should be gone
having this issue early on a sunday morning, hoping its fixed by tomorrow or build pipeline hell. Is definitely related to escaping of urls. Right now working with --prefer-offline.
I did install v2, regretted it, and tried to move back 1.22.5 yesterday. But I believe it was unrelated although I cannot remember at this point. no .yarn .yarnrc removed as well.
I have a different registry set in .npmrc
, but npm install
handles that just fine. What gives with yarn?
Most helpful comment
@roytz are u by chance having any network issues (Firewall, etc)? Or, do you have a different registry set for any of your
.yarnrc
or.npmrc
files?Can you run the same command and include the
--verbose
flag, then post the log here?