Skip to content
JsDevLife
Menu
  • Home
  • Leetcode in JS
  • About me
  • Contact Us
Menu

Fixing : An unexpected error occurred:latmap-stream/-/flatmap-stream-

Posted on January 31, 2019 by Vikas Kad
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 andevent-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.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Solving LeetCode Problem 79 – Word Search in JavaScript
  • Solving LeetCode Problem 48: Rotate Image using JavaScript
  • Solving the “Container With Most Water” LeetCode Problem in JavaScript – A Comprehensive Guide
  • LeetCode Solution: 54: Spiral Matrix in JavaScript
  • Solution to LeetCode Problem 31. Next Permutation in JavaScript

Archives

  • 2023 (5)
  • 2022 (20)
  • 2021 (2)
  • 2020 (4)
  • 2019 (14)
  • 2018 (17)

Categories

  • blockchain development
  • Blog
  • crystal
  • flutter
  • flutter.io
  • GitHub
  • Installation
  • Ionic Framework
  • javascript
  • leetcode-in-js
  • masteringInJavasript
  • mcqs
  • MongoDB
  • nodejs
  • Object Oriented Javacript
  • python
  • smart contracts
  • visual studio

Quick Links

  • Home
  • Leetcode in JS
  • About me
  • Contact Us

Terms of service

  • Terms Of Service
  • Disclaimer
©2023 JsDevLife | Design: Newspaperly WordPress Theme