I installed material-UI and I'm trying to import a button and it's throwing me an error.
The code (inside my index.js file in client folder) :
import React, { Component } from 'react'
import { render } from 'react-dom'
import { Launcher } from '../../src'
import messageHistory from './messageHistory';
import Highlight from "react-highlight.js";
import './../assets/styles'
import io from 'socket.io-client';
import ReactDOM from 'react-dom';
import Button from '@material-ui/core/Button';
error:
ERROR in ../~/@material-ui/core/Button/Button.js
Module not found: Error: Can't resolve 'react' in `'C:\Users\dale.grant\Desktop\hyberchat-chat-service\node_modules\@material-ui\core\Button'`
And it says this about 11 times just with different parts such as Button/ripple.js
One thing I've noticed is I have a package-json and a package-lock.json for this client side and for my server side, and the material-ui is inside the package-lock.json for my server side? Anyway, I've tried deleting the node-modules etc a few times and restarting them.
Not sure if I've missed something? I created the app from 'react-chat-window' not sure if that is 'create-react-app' but I think it is?
I also tried installing material-ui while inside my client folder too.
The client is run by web-pack and server just normal node.
package.json:
"dependencies": {
"emoji-js": "3.2.2",
"gh-pages": "^1.0.0",
"material-ui": "^0.20.2",
"prop-types": "15.5.10",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-highlight.js": "1.0.5",
"socket.io-client": "2.0.3"
also the client package.json:
"body-parser": "^1.18.3",
"dialogflow": "^0.7.0",
"express": "^4.16.3",
"nodemon": "^1.18.4",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"socket.io": "^2.1.1"
thanks.