【发布时间】:2017-11-16 03:56:32
【问题描述】:
出于特殊原因,我想在 web(react 应用程序)和 mobile 两个文件夹之间共享 package.json 文件:
▸ mobile/
▸ node_modules/
▾ web/
▸ public/
▸ src/
README.md
package-lock.json
package.json
yarn.lock
在我的 package.json 文件中,我添加了这个:
"web-start": "react-scripts start", 在脚本下。但是,当我在根文件夹 (/Users/edmund/Documents/src/banana-client) 中运行它时,我得到了这个:
➜ banana-client git:(master) ✗ yarn web-start
yarn web-start v0.24.6
$ react-scripts start web
Could not find a required file.
Name: index.html
Searched in: /Users/edmund/Documents/src/banana-client/public
error Command failed with exit code 1.
有没有办法添加根目录?
【问题讨论】:
-
你使用弹出的 create-react-app 吗?
react-scripts是 CRA 的一部分...