模块构建失败:错误:找不到相对于目录的预设“stage-0”

gre*_*fox 3 node.js npm webpack

我收到以下错误,但仅当我尝试使用以下依赖项时才出现,否则它工作正常。

错误:

Module build failed: Error: Couldn't find preset "stage-0" relative to directory
Run Code Online (Sandbox Code Playgroud)

导入导致问题

import {ActionDone} from "material-ui"

它是 React-Material-icons npm 包的一部分。如果我删除该导入并使用它,一切都会正常。我缺少什么?

小智 7

你只需要安装 babel-preset-stage-0:

为此的命令:

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