【发布时间】:2019-03-26 23:10:30
【问题描述】:
我正在使用 create-react-app。当我第一次运行“npm start”时,一切正常。但是,当我取消该过程时,localhost 开始返回 404。
这是我的终端:
Compiled with warnings.
./src/components/NameSelection.jsx
Line 21: Expected '===' and instead saw '==' eqeqeq
./src/components/RelationshipSelection.jsx
Line 25: Expected '===' and instead saw '==' eqeqeq
Line 99: 'options' is assigned a value but never used no-unused-vars
./src/components/PreferenceSelection.jsx
Line 5: 'url' is defined but never used no-unused-vars
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
^C
Daniels-MacBook-Pro:test dcaine$ yarn start
yarn run v1.9.2
$ serve -s build
┌──────────────────────────────────────────────────┐
│ │
│ Serving! │
│ │
│ - Local: http://localhost:5000 │
│ - On Your Network: http://192.168.1.73:5000 │
│ │
│ Copied local address to clipboard! │
│ │
└──────────────────────────────────────────────────┘
我不确定这是否相关,但是:当我最初运行 yarn start 时,它位于端口 3000,取消后它变为 5000。
当我运行 npm build 后跟 npm start 时,应用程序将启动并构建我所做的任何更改,但任何后续更改都不会反映在应用程序中(直到我重复此过程)。
什么可能导致这种情况发生?
【问题讨论】:
标签: npm http-status-code-404 create-react-app yarnpkg