首页 文章

npm在create-react-app之后开始工作

提问于
浏览
0

我正在尝试使用以下步骤创建一个反应应用程序:

  • npm install -g create-react-app

  • create-react-app my-app

  • cd my-app

  • npm开始

我收到这个错误:

enter image description here

错误有建议删除webpack依赖,但我不能这样做,因为在文件package.json dun有 . 这是我的package.json

enter image description here

有关其他信息:

  • 我正在使用Windows 10

  • npm 6.4.1

  • create-react-app version 2.0.3

  • node v8.12.0

3 回答

  • 0

    只需执行以下步骤:

    • 删除package-lock.json .
    • 删除node_modules .
    • npm安装 .

    要么

    只需尝试错误日志中提到的步骤,您就可以了 .
    enter image description here

  • 0

    我刚刚遇到这个问题,结果很简单

    日志的一部分说有关于

    “在树中检测到不同版本的webpack”

    看起来对你来说是一样的 . 我想你可能已经在D:\ bolehDiHapus下运行了 npm install ,所以在你想要的树上安装了node_modules .

    我只是更改了D:\ bolehDiHapus \ node_modules的名称(可能最好只删除它)并且嘿presto npm start 工作 .

  • 0

    执行第6步并删除该babel loader或webpack文件夹,之后您将会很好 . 您有可能在之前的项目中安装了过时的Web包或babel .

相关问题