'TypeError: flatMap is not a function

I was trying to install parcel to run my own npm package but I get the following error when starting the HTML with parcel lib:

TypeError: [(...previousDevDepRequests.entries(...))].filter(...).flatMap is not a function
    at Object.run (C:\Users\ishantr\AppData\Roaming\npm\node_modules\parcel\node_modules\@parcel\core\lib\requests\AssetRequest.js:94:122)

I am on v10.16.0, and my index template is something like this:

<img src="xxx.jpg" alt="" class="some_class_name">
<script src="./index.js"></script>

It calls the js file to run some business logic.



Solution 1:[1]

you should consider upgrading to node 14.x . it worked for me ..i was using node version 10.19.0

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 souleymene hamrouni