【问题标题】:Could not find plugin "proposal-class-properties" [duplicate]找不到插件“proposal-class-properties”[重复]
【发布时间】:2020-10-16 12:55:52
【问题描述】:

我正在做 React 项目。它工作正常。但是现在每当我启动 npm 时。它给了我错误:

$ react-scripts start
i 「wds」: Project is running at http://192.168.18.45/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from C:\xampp\htdocs\SkyHi\Staah\staah-instant-site\public
i 「wds」: 404s will fallback to /
Starting the development server...
Failed to compile.

./node_modules/@fortawesome/fontawesome-svg-core/index.es.js
Error: [BABEL] C:\xampp\htdocs\SkyHi\Staah\staah-instant-site\node_modules\@fortawesome\fontawesome-svg-core\index.es.js: Could not find plugin "proposal-class-properties". Ensure there is an entry in ./available-plugins.js for it. (While processing: "C:\\xampp\\htdocs\\SkyHi\\Staah\\staah-instant-site\\node_modules\\babel-preset-react-app\\dependencies.js$0")
    at Array.map (<anonymous>)
    at Generator.next (<anonymous>)
    at Generator.next (<anonymous>)

我正在使用yarn

我该如何解决这个错误?

【问题讨论】:

  • 你的 package.json 是否包含 @babel/plugin-proposal-class-properties?
  • 是的。它在那里。为临时。我已经卸载了 node_module 目录并重新安装它。但我认为这不是解决此问题的正确方法。他们可能是解决这个问题的正确方法。希望这篇文章能帮助人们花时间寻找解决方案。希望有人能正确回答。
  • 同样的问题,尝试了一切,但没有解决方案。 (即使删除 node_module 也没有解决问题)

标签: reactjs npm yarnpkg


【解决方案1】:

在 package.json 中添加 "resolutions": { "@babel/preset-env": "7.5.5" }。

运行 npx npm-force-resolutions

运行 npm install 或 yarn。

Could not find plugin "proposal-numeric-separator"的回答

【讨论】:

    猜你喜欢
    • 2021-05-23
    • 2022-06-12
    • 2022-08-15
    • 1970-01-01
    • 2019-05-01
    • 1970-01-01
    • 2020-07-01
    • 2021-02-13
    • 2019-05-16
    相关资源
    最近更新 更多