我正在尝试运行yarn start
并遇到以下错误:
? /User/platform/src/containers/App.js: Cannot resolve dependency 'core-js/modules/es6.array.iterator'
这是我的package.json:
{
"name": "static-site-mailer",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"private": true,
"dependencies": {
"@babel/polyfill": "^7.8.7",
"aws-sdk": "^2.661.0",
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"bootstrap": "^4.4.1",
"core-js": "^3.6.5",
"es6-promise": "^4.2.8",
"html-webpack-plugin": "^4.2.0",
"isomorphic-fetch": "^2.2.1",
"jquery": "1.9.1 - 3",
"popper.js": "^1.16.0",
"react": "^16.13.1",
"react-bootstrap": "^1.0.1",
"react-dom": "^16.13.1",
"react-modal": "^3.11.2",
"react-modal-login": "^1.4.5",
"react-modal-plugin": "^1.0.3",
"react-router-dom": "^5.1.2",
"regenerator-runtime": "^0.13.5",
"xmlhttprequest": "^1.8.0"
},
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/preset-env": "^7.9.5",
"@babel/preset-react": "^7.9.4",
"@testing-library/jest-dom": "^5.5.0",
"@testing-library/react": "^10.0.3",
"babel-eslint": "^10.1.0",
"babel-jest": "^25.4.0",
"babel-loader": "^8.1.0",
"eslint": "^6.8.0",
"eslint-loader": "^3.0.4",
"eslint-plugin-react": "^7.19.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^25.4.0",
"parcel-bundler": "^1.12.4",
"react-test-renderer": "^16.13.1",
"sass": "^1.26.3",
"webpack": "^4.43.0"
},
"scripts": {
"start": "parcel ./src/index.html",
"test": "jest",
"build": "rm -rf dist && parcel build ./src/index.html",
"watch": "parcel ./src/index.html"
},
"jest": {
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
"\\.(scss|css|less)$": "identity-obj-proxy"
}
}
}
这是怎么回事?我假设我使用了其中一个软件包的错误版本?我已经卸载并重新安装了几次软件包,但这似乎没有什么作用。
答案 0 :(得分:0)
我通过 npm 下载了 core-js@3.6.5 并查看了以下路径:
<块引用>核心js/模块
modules 目录不包含文件 es6.array.iterator.js,但它包含 es.array.iterator。< /p>
尝试将受影响文件中的路径 'core-js/modules/es6.array.iterator.js'
更改为 'core-js/modules/es.array.iterator.js'
。