gpt4 book ai didi

reactjs - 找不到插件 "proposal-numeric-separator"

转载 作者:行者123 更新时间:2023-12-03 12:54:47 26 4
gpt4 key购买 nike

如何修复找不到插件“proposal-numeric-separator”,当我尝试构建我的 React 应用程序时收到此错误,我尚未弹出该应用程序:

./src/index.js
Error: [BABEL] /home/pc/Downloads/project/src/index.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "/home/pc/Downloads/project/node_modules/babel-preset-react-app/index.js$0")
at Array.map (<anonymous>)
at Generator.next (<anonymous>)
at Generator.next (<anonymous>)


error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

我尝试下载 Babel 和依赖项 Proposal Numeric Separator,删除节点模块,清理 Yarn 缓存;但没有任何效果。

我使用的是 Yarn 1.22.4 和 Node 13.11.0,但我也尝试过使用 NPM 6.13.7。

最佳答案

以下步骤有效:

  1. 将以下行添加到 package.json:
"resolutions": { 
"@babel/preset-env": "7.5.5"
},
  • 运行以下命令:
  • $ npx npm-force-resolutions
  • 安装依赖项:
  • $ npm install
    # or
    $ yarn
  • 构建您的项目:
  • $ yarn build

    看看这个 Github Issue

    关于reactjs - 找不到插件 "proposal-numeric-separator",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60780664/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com