Chunk.entrypoints:改用Chunks.addGroup

时间:2018-07-02 13:30:19

标签: javascript reactjs

我正在使用npm 6.0.1版本。 我的操作系统是macOs High Sierra版本10.13.3

我想构建我的项目,但收到以下错误消息:

Creating an optimized production build...
/Users/mohammadmehdi/Documents/Work/sevenapp/node_modules/webpack/lib/Chunk.js:533
        throw new Error("Chunk.entrypoints: Use Chunks.addGroup instead");
        ^

Error: Chunk.entrypoints: Use Chunks.addGroup instead
    at Chunk.set (/Users/mohammadmehdi/Documents/Work/sevenapp/node_modules/webpack/lib/Chunk.js:533:9)
    at /Users/mohammadmehdi/Documents/Work/sevenapp/node_modules/extract-text-webpack-plugin/dist/index.js:176:40
    at Array.forEach (<anonymous>)
    at Compilation.<anonymous> (/Users/mohammadmehdi/Documents/Work/sevenapp/node_modules/extract-text-webpack-plugin/dist/index.js:171:18)
    at Compilation.applyPluginsAsyncSeries (/Users/mohammadmehdi/Documents/Work/sevenapp/node_modules/react-scripts/node_modules/tapable/lib/Tapable.js:206:13)
    at Compilation.seal (/Users/mohammadmehdi/Documents/Work/sevenapp/node_modules/react-scripts/node_modules/webpack/lib/Compilation.js:605:8)
    at applyPluginsParallel.err (/Users/mohammadmehdi/Documents/Work/sevenapp/node_modules/react-scripts/node_modules/webpack/lib/Compiler.js:508:17)
    at /Users/mohammadmehdi/Documents/Work/sevenapp/node_modules/react-scripts/node_modules/tapable/lib/Tapable.js:289:11
    at _addModuleChain (/Users/mohammadmehdi/Documents/Work/sevenapp/node_modules/react-scripts/node_modules/webpack/lib/Compilation.js:507:11)
    at processModuleDependencies.err (/Users/mohammadmehdi/Documents/Work/sevenapp/node_modules/react-scripts/node_modules/webpack/lib/Compilation.js:477:14)
    at process._tickCallback (internal/process/next_tick.js:172:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sevenapp@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sevenapp@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mohammadmehdi/.npm/_logs/2018-07-02T13_17_58_331Z-debug.log

这是我的package.json

{
  "name": "sevenapp",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "axios": "^0.18.0",
    "bootstrap": "^4.0.0",
    "jquery": "^3.3.1",
    "rc-pagination": "^1.16.4",
    "react": "^16.2.0",
    "react-countup": "^3.0.3",
    "react-dom": "^16.2.0",
    "react-paginate": "^5.2.3",
    "react-player": "^1.6.4",
    "react-popup": "^0.9.3",
    "react-redux": "^5.0.7",
    "react-router": "^4.2.0",
    "react-router-dom": "^4.2.2",
    "react-scripts": "1.1.1",
    "redux": "^4.0.0"
  },
  "scripts": {
    "start": "PORT=3000 react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "description": "",
  "main": "index.js",
  "devDependencies": {
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.4",
    "css-loader": "^0.28.11",
    "jshint": "^2.9.5",
    "jshint-loader": "^0.8.4",
    "style-loader": "^0.21.0",
    "webpack": "^4.6.0",
    "webpack-cli": "^2.0.15"
  },
  "author": "",
  "license": "ISC"
}

我运行以下命令:

npm run build --release

我需要安装webpack吗? 我可以在没有webpack的情况下构建我的项目吗? 我要发布我的项目吗?

我不知道我怎么了。

1 个答案:

答案 0 :(得分:4)

webpack-contrib/extract-text-webpack-plugin#701相关的外观。

运行npm install -D extract-text-webpack-plugin@next为我在本地解决了该问题。

您还可以在链接https://github.com/facebook/create-react-app/issues/4356下方的此处检查同一线程