Failed to compile ./src/App.js Module not found: Can't resolve

cmyk picture cmyk · Feb 13, 2018 · Viewed 13.4k times · Source

I got following error when I start to run the local server:

Failed to compile ./src/App.js Module not found: Can't resolve './Main' in '/home/sol/React/kuehnfotografie/src'

Folder structure

This is the main.js file:

import React from 'react';
import ReactDOM from 'react-dom';
import { Provider, createComponent } from 'react-fela';
import { createRenderer } from 'fela';
import Header from './main/Header';
import Content from  './main/Content';
import Footer from './main/Footer';

class Main extends React.Component {
  render() {
    return (
      <div className="main">
        <Header />
        <Content />
        <Footer />
      </div>
    );
  }
} 

export default Main;

Answer

Jayani Sumudini picture Jayani Sumudini · Oct 6, 2018

Try to remove

package-lock.json

, run

npm install

and then

npm run

start again.