Hello All,
As you come on this page then I am sure that you got the following error while running yarn install
An unexpected error occurred: “https://registry.yarnpkg.com/flatmap-stream/-/flatmap-stream-0.1.1.tgz: Request failed “404 Not Found””.
This is not a yarn bug, it’s due to the removal of the malicious code in the flatmap package used to steal bitcoin funds from Copay wallets. The fix is to find any packages that depend on and
event-stream
update them. In my case it was,nodemon
and the most recent update removes the event-stream dependency.
So you can do the following steps to fix this:
- Go into yarn global folder: cd ~/.config/yarn/global/ (or wherever yarn global files present)
- Search for
flatmap-
in current folder:grep -R flatmap-* ./
- Manually and recursively remove all folders that contain it, e.g.:
rm -rf ./node_modules/flatmap-stream ./node_modules/event-stream
, etc.
- Now remove above modules from the current project directory as well.
rm -rf ./node_modules/flatmap-stream
rm -rf ./node_modules/event-stream
- Remove yarn lockfile:
rm yarn.lock
Rebuilt yarn by typing a command, e.g. yarn global list
That’s it now it should run properly.
Comment if you still facing the issue.