尝试在我的 React 项目中实现 react-speech-recognition 时出错。
这是我的 package.json
文件
{
"name": "smart-mirror",
"version": "0.1.0",
"private": true,
"dependencies": {
"@babel/runtime": "^7.13.10",
"@material-ui/core": "^4.11.3",
"@material-ui/icons": "^4.11.2",
"axios": "^0.21.1",
"firebase": "^8.3.1",
"firebase-admin": "^9.5.0",
"install": "^0.13.0",
"npm": "^7.7.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-icons": "^4.2.0",
"react-modal": "^3.12.1",
"react-scripts": "1.1.5",
"react-speech-recognition": "^3.7.0",
"react-spring": "^9.0.0-rc.3",
"styled-components": "^5.2.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.13.10",
"@babel/core": "^7.8.7",
"babel-loader": "^8.2.2",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-0": "^6.24.1"
}
}
在做了一些研究之后,我发现了它的 babel 版本。所以我安装了较新的版本。但我仍然遇到同样的错误
答案 0 :(得分:0)
尝试将 react 版本降级到 v16.0.2