reactjs - create-react-app 之后 npm start 不工作

标签 reactjs create-react-app npm-start

我正在尝试通过以下步骤创建一个 react 应用程序:

  1. npm install -g create-react-app
  2. 创建 react 应用程序我的应用程序
  3. cd my-app
  4. npm 启动

我收到此错误:

enter image description here

错误地建议删除 webpack 依赖项,但我无法这样做,因为在文件 package.json 中没有这样做。这是我的 package.json

enter image description here

欲了解更多信息:

  • 我使用的是 Windows 10
  • npm 6.4.1
  • create-react-app 版本 2.0.3
  • 节点 v8.12.0

最佳答案

只需执行以下步骤:
- 删除package-lock.json。
- 删除node_modules。
- npm 安装。

或者

只要尝试错误日志中提到的步骤就可以了。 enter image description here

关于reactjs - create-react-app 之后 npm start 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52801245/

相关文章:

javascript - 在新窗口中弹出一个 React 组件

javascript - React : cannot add property 'X' , 对象不可扩展

javascript - 如何在 JSX 中添加自定义 html 属性

reactjs - 如何在手机上预览 React 应用程序?

react-native - Metro Bundler 准备就绪。错误 ENOSPC : System limit for number of file watchers reached, watch

javascript - 在 render 中调用方法或使用 getter

reactjs - 在 create-react-app 项目中将 svg 作为 ReactComponent 导入时出现未定义

reactjs - 从 jsx 文件导入 sass 变量

angularjs - 当我运行 "npm start"时正在运行哪些 js 文件?