Use file-saver-es instead.
npm install -S file-saver-es
Then in your code import saveAs and other codes keep as before.
import { saveAs } from 'file-saver-es';
and if you’re using typescript add following to your tsconfig
:
"paths": {
"file-saver-es": [
"@types/file-saver"
]
}