我想在我的React应用程序中显示一个Material按钮,但是我收到了这个错误:
Failed to compile.
./node_modules/@material-ui/core/styles/index.js
Module not found: Can't resolve '/Users/hugovillalobos/Documents/Code/LumiereProject/lumiere_frontend/node_modules/react-scripts/node_modules/babel-loader/lib/index.js' in '/Users/hugovillalobos/Documents/Code/LumiereProject/lumiere_frontend'
这是我的App.js
:
import React, { Component } from 'react';
import './App.css';
import LoginModal from './components/Login';
class App extends Component {
render() {
return (
<div className="App">
<LoginModal />
</div>
);
}
}
export default App;
这是我的模块:
import React, { Component } from 'react';
import { withStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
class LoginModal extends Component {
render() {
return(
<div>
<Button variant="contained" className="{classes.Button}">
Welcome to Lumiere...
</Button>
</div>
);
}
}
export default LoginModal;
一切正常,直到我尝试在我的应用程序中使用Material组件。也许我缺少安装某些东西,但我遵循的文档并不特别需要任何东西。