升级三星node_modules/babel preset react app/index.js$0的reactjs未知版本4后无法生成
我已经更新了我的react js应用程序(react+redux+react router),当我尝试构建它时,我看到了一个奇怪的错误升级三星node_modules/babel preset react app/index.js$0的reactjs未知版本4后无法生成,reactjs,Reactjs,我已经更新了我的react js应用程序(react+redux+react router),当我尝试构建它时,我看到了一个奇怪的错误 ./src/index.js BrowserslistError: [BABEL] /home/sateesh/apps/react-app/src/index.js: Unknown version 4 of samsung (While processing: "/home/sateesh/apps/react-app/node_modul
./src/index.js
BrowserslistError: [BABEL] /home/sateesh/apps/react-app/src/index.js: Unknown version 4 of samsung (While processing: "/home/sateesh/apps/react-app/node_modules/babel-preset-react-app/index.js$0")
at Array.reduce (<anonymous>)
at Array.reduce (<anonymous>)
at Generator.next (<anonymous>)
at Generator.next (<anonymous>)
最后是我的package.json
{
"name": "react-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"axios": "^0.21.0",
"lodash": "^4.17.20",
"moment": "^2.29.1",
"node-fetch": "^2.6.1",
"rc-tooltip": "^5.0.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-redux": "^7.2.2",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.0",
"react-spinners": "^0.9.0",
"redux": "^4.0.5",
"redux-form": "^8.3.7",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"reqwest": "^2.0.5",
"semantic-ui-react": "^2.0.1",
"web-vitals": "^0.2.4"
},
"scripts": {
"start": "react-scripts start",
"build:local": "REACT_APP_ENV=local react-scripts build",
"build:dev": "REACT_APP_ENV=dev react-scripts build",
"build:test": "REACT_APP_ENV=test react-scripts build",
"build:prod": "REACT_APP_ENV=prod react-scripts build",
"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"
]
}
}
谢谢
Sateesh您是否尝试过将软件包版本更改回滚到工作状态,然后一次更新一个以查看其中断位置?您是否尝试过将软件包版本更改回滚到工作状态,然后一次更新一个以查看其中断位置?
'use strict';
const create = require('./create');
module.exports = function (api, opts) {
// This is similar to how `env` works in Babel:
// We are not using `env` because it’s ignored in versions > babel-core@6.10.4:
// It’s also nice that we can enforce `NODE_ENV` being specified.
const env = process.env.BABEL_ENV || process.env.NODE_ENV;
return create(api, opts, env);
};
{
"name": "react-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"axios": "^0.21.0",
"lodash": "^4.17.20",
"moment": "^2.29.1",
"node-fetch": "^2.6.1",
"rc-tooltip": "^5.0.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-redux": "^7.2.2",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.0",
"react-spinners": "^0.9.0",
"redux": "^4.0.5",
"redux-form": "^8.3.7",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0",
"reqwest": "^2.0.5",
"semantic-ui-react": "^2.0.1",
"web-vitals": "^0.2.4"
},
"scripts": {
"start": "react-scripts start",
"build:local": "REACT_APP_ENV=local react-scripts build",
"build:dev": "REACT_APP_ENV=dev react-scripts build",
"build:test": "REACT_APP_ENV=test react-scripts build",
"build:prod": "REACT_APP_ENV=prod react-scripts build",
"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"
]
}
}