Add “@babel/plugin-proposal-private-property-in-object“ to your devDependencies to work

One of your dependencies, babel-preset-react-app, is importing the
“@babel/plugin-proposal-private-property-in-object” package without
declaring it in its dependencies. This is currently working because
“@babel/plugin-proposal-private-property-in-object” is already in your
node_modules folder for unrelated reasons, but it may break at any time.

babel-preset-react-app is part of the create-react-app project, which
is not maintianed anymore. It is thus unlikely that this bug will
ever be fixed. Add “@babel/plugin-proposal-private-property-in-object” to
your devDependencies to work around this error. This will make this message
go away.

解决方法

如果你使用npm,运行以下命令:

npm install --save-dev @babel/plugin-proposal-private-property-in-object

如果你使用yarn,运行以下命令:

yarn add --dev @babel/plugin-proposal-private-property-in-object

这些命令会将@babel/plugin-proposal-private-property-in-object包添加到你的devDependencies中,并解决报错。它会自动下载并安装该包的最新版本。

猜你喜欢

转载自blog.csdn.net/qq_46110497/article/details/131237350