我遇到了一个问题“@babel/plugin-proposal-private-property-in-object”

zbq4xfa0  于 2023-09-28  发布在  Babel
关注(0)|答案(1)|浏览(480)

我试着卸载它,删除package.json文件,我也试着添加到“devDependencies”,但没有任何效果。因为这个我不能部署我的应用程序。我该怎么办?
信息:
你的一个依赖项babel-preset-react-app正在导入“@babel/plugin-proposal-private-property-in-object”包,而没有在它的依赖项中声明它。这是因为“@babel/plugin-proposal-private-property-in-object”由于不相关的原因已经在您的node_modules文件夹中,但它可能随时中断。
babel-preset-react-app是create-react-app项目的一部分,不再维护。因此,这个bug不太可能被修复。将“@babel/plugin-proposal-private-property-in-object”添加到devDependencies中以解决此错误。这将使此消息消失。
我的package.json文件:

{
  "name": "parking-app",
  "version": "0.1.0",
  "private": true,
  "proxy": "http://localhost:3000",
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "firebase": "^9.22.2",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-firebase-hooks": "^5.1.1",
    "react-router-dom": "^6.11.0",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  },
  "devDependencies": {
    "@babel/plugin-proposal-private-property-in-object": "^1.0.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}
x3naxklr

x3naxklr1#

问题出在“@babel/plugin-proposal-private-property-in-object”的版本中。您已将其设置为不存在的版本“^1.0.0”。将版本更改为“^7.16.0”,然后执行“npm ci”命令。之后,那恼人的警告就会消失。

相关问题