Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
721 views
in Technique[技术] by (71.8m points)

reactjs - Could not find plugin "proposal-numeric-separator"

How to fix Could not find plugin "proposal-numeric-separator", I get this error when I try to build my React application, I have not ejected the application yet:

./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.

I have tried to download Babel and the dependency Proposal Numeric Separator, remove the Node Modules, clean the Yarn cache; but nothing worked.

I'm using Yarn 1.22.4 and Node 13.11.0, but I have also tried with NPM 6.13.7.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The following steps work:

  1. Add the following line to package.json:
"resolutions": { 
  "@babel/preset-env": "7.5.5" 
},
  1. Run the following command:
$ npx npm-force-resolutions
  1. Install dependencies:
$ npm install
# or 
$ yarn
  1. Build your project:
$ yarn build

Take a look at this Github Issue


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...