greyfox
greyfox

Reputation: 6606

Module build failed: Error: Couldn't find preset "stage-0" relative to directory

I am getting the following error but only when I try to use the following dependency, otherwise it works fine.

Error:

Module build failed: Error: Couldn't find preset "stage-0" relative to directory

Import causing the issue

import {ActionDone} from "material-ui"

It is part of the react-material-icons npm package. If I remove that import and uses of it everything works fine. What am I missing?

Upvotes: 3

Views: 6189

Answers (3)

Ishwor Khadka
Ishwor Khadka

Reputation: 33

Reinstall babel using command

npm i --save-dev babel-preset-stage-0

Upvotes: 1

Mansi  Teharia
Mansi Teharia

Reputation: 1077

You only need to install babel-preset-stage-0:

Command for this:

npm install --save-dev babel-preset-stage-0

Upvotes: 7

Sanjit Roy
Sanjit Roy

Reputation: 187

Try installing the stage 0 preset.

Refer to this article: https://babeljs.io/docs/plugins/preset-stage-0/

Upvotes: 2

Related Questions