0

I am trying to setup a environment for my react app development. I used initially

create-react-app

command and that worked perfectly fine. However, I like to keep only the modules that I would be using rather than generic modules needed for the development. Hence, I decided to set up an environment the following way,

mkdir <reactapp name>
cd <reactapp name>
npm init

Then install the required packages that I would be using for my development. My package.json is as follows,

{
  "name": "reactdash",
  "version": "0.0.1",
  "description": "D3js - react interactive visualization dashboard",
  "main": "index.js",
  "keywords": [
    "d3",
    "react"
  ],
  "author": "Russell Bertrand",
  "license": "ISC",
  "devDependencies": {
    "babel-cli": "^6.24.1",
    "react": "^15.6.1",
    "react-dom": "^15.6.1",
    "react-scripts": "^1.0.10",
    "webpack": "^3.2.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}

When I try to

npm start

My error message is as follows,

russellb@eigen:~/russell/ReactApp/reactdash$ npm start

> reactdash@0.0.1 start /home/russellb/russell/ReactApp/reactdash
> react-scripts start

Could not find a required file.
  Name: index.html
  Searched in: /home/russellb/russell/ReactApp/reactdash/public
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! reactdash@0.0.1 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the reactdash@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/russellb/.npm/_logs/2017-07-13T18_14_01_871Z-debug.log/2017-07-13T18_14_01_871Z-debug.log

However, index.html is present in the 'src' directory under .

Could anyone shed some light on how to debug this?

Bussller
  • 1,961
  • 6
  • 36
  • 50
  • 1
    isn't it searching index.html in public folder? Did you placed it in public folder and tried? – error404 Jul 13 '17 at 18:34
  • It seems to me that this is a webpack error. It is looking for your index.html in your public directory. put your dynamic code in src and static assets in your public folder. – EJ Mason Jul 13 '17 at 20:48
  • @AnamulHasan: Thanks. That does the trick, after placing the html in the public folder, it started. – Bussller Jul 14 '17 at 01:29
  • @EJMason: Thanks for indicating me the webpack possibility. I am trying to understand how webpack technically works. If you have any usggestions, tutorials or docs, feel free to comment. – Bussller Jul 14 '17 at 01:31

0 Answers0