首页 > 解决方案 > 如何升级 create-react-app 添加的依赖项

问题描述

我们何时以及如何升级create-react-app添加到的依赖项package.json

今天我跑了npx create-react-app my-app --template typescript,它添加了这些依赖项:

  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.2",
    "@testing-library/user-event": "^7.1.2",
    "@types/jest": "^24.0.0",
    "@types/node": "^12.0.0",
    "@types/react": "^16.9.0",
    "@types/react-dom": "^16.9.0",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-scripts": "3.4.3",
    "typescript": "~3.7.2"
  }

即使有些有更新的版本可用:

我们可以随时升级任何依赖项还是与特定版本相关联react-scripts?如果是后者,我们如何知道何时升级以及升级到什么版本?

标签: create-react-app

解决方案


推荐阅读