Search code examples
node.jsantd

Ant design charts install error: '__spreadArray' is not exported from 'tslib'


I tried to install ant design charts but I get the following error:

./node_modules/@antv/algorithm/es/gaddi.js
Attempted import error: '__spreadArray' is not exported from 'tslib'.

I get 0 warnings. the steps I have done:

  1. npm install @ant-design/charts
  2. npm install tslib --save
  3. npm audit fix
  4. npm react update
  5. npm i typescript

I tried like 3 times reinstalling these, but none of them solved my problems. Any idea what's wrong and how can I solve it?


Solution

  • Apparently by installing the latest tslib package worked for me:

    npm install tslib@latest --save