我使用了cli实用程序create-react-app创建了一个项目。
当我使用npm start时,一切都如预期的一样。
但是当我尝试运行“npm run-script build”时,我会收到下面的错误:
./src/index.css
模块构建失败:BrowserslistError:未知浏览器查询“dead”
在数组中forEach(<anonymous>)
我的package.json文件的结构如下:
`{
"name": "site",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.2.0",
"react-bootstrap": "^0.32.1",
"react-dom": "^16.2.0",
"react-router-dom": "^4.2.2",
"react-scripts": "1.1.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}`
如果我删除 "not dead",它就会构建成功,但我觉得这样可能会导致未来出现问题。是否有人遇到过这个错误?知道解决方法吗?我需要担心去掉这个吗?