我正在尝试为我的反应应用程序开发设置一个环境。我最初用过
create-react-app
命令,并且完美无缺。但是,我只想保留我将使用的模块,而不是开发所需的通用模块。因此,我决定以下列方式建立一个环境,
mkdir <reactapp name>
cd <reactapp name>
npm init
然后安装我将用于开发的必需软件包。我的package.json如下,
{
"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"
}
}
当我尝试
时npm start
我的错误信息如下,
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
然而,index.html出现在&#39; src&#39;目录下。
有人能说明如何调试这个吗?