已经完成的无效步骤: 删除package-lock.json,运行npm install并再次启动npm,会发生相同的错误。
index.js /导入:
import React from 'react';
import ReactDOM from 'react-dom';
import data from './content.json';
import './index.css';
打包JSON:
{
"name": "base",
"version": "0.1.0",
"private": true,
"dependencies": {
"eslint": "^5.16.0",
"jquery": "^3.3.1",
"lodash": "^4.17.11",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-scripts": "2.1.3",
"rm": "^0.1.8",
"webpack": "^4.30.0",
"yarn": "^1.15.2"
},
"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"
]
}
从软件包中删除浏览器列表会再次执行此操作,并且会出现相同的错误。