我看到这个问题100%尝试构建Webpack进行生产。
我已经尝试过其他类似的StackOverflow问题中提到的方法,即NODE_OPTIONS=--max_old_space_size=8192
我的构建命令是:
"build": "NODE_OPTIONS=--max_old_space_size=8192 rimraf build && cross-env NODE_ENV=production webpack --config tools/webpack.prod.config.js -p --progress",
您是否看到关于我如何通过期权的问题? 此版本是在Travis上执行的,该版本使用的是Node版本8.14.0,很遗憾,目前我无法升级该版本。
错误仍然存在:
<s> [webpack.Progress] 96% [0] chunk asset optimization TerserPlugin
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received
The build has been terminated
一个重要的细节是,在我的本地主机上构建不会失败,在CI上它会100%地失败。
我的package.json:
{
"private": true,
"scripts": {
"build": "NODE_OPTIONS=--max_old_space_size=8192 rimraf build && cross-env NODE_ENV=production webpack --config tools/webpack.prod.config.js -p",
},
"engines": {
"node": ">=8.9"
},
"dependencies": {
"@apollo/react-hooks": "3.1.5",
"@atmedia/react-gpt": "2.1.1",
"@babel/register": "7.10.1",
"@optimizely/react-sdk": "2.0.1",
"algoliasearch": "4.3.0",
"alphanumeric-id": "1.0.1",
"antd": "4.4.0",
"apollo-boost": "0.4.7",
"bluebird": "3.7.2",
"body-parser": "1.19.0",
"body-scroll-lock": "3.0.3",
"browser-update": "3.3.19",
"classnames": "2.2.6",
"compression": "1.7.4",
"connected-react-router": "6.0.0",
"copy-to-clipboard": "3.3.1",
"core-js": "3.6.5",
"crypto-js": "4.0.0",
"date-fns": "2.14.0",
"deep-assign": "3.0.0",
"diff": "4.0.2",
"draft-js": "0.11.6",
"draft-js-linkify-plugin": "2.0.2",
"draft-js-mention-plugin": "3.1.5",
"draft-js-plugins-editor": "3.0.0",
"express": "4.17.1",
"express-healthcheck": "0.1.0",
"faker": "4.1.0",
"filter-react-props": "0.0.4",
"formik": "1.5.8",
"foundation-sites": "6.5.3",
"get-orientation": "1.1.2",
"graphql": "15.1.0",
"heapdump": "0.3.15",
"history": "4.9.0",
"hoist-non-react-statics": "3.3.2",
"https": "1.0.0",
"ignore-styles": "5.0.1",
"immutable": "3.8.2",
"isomorphic-fetch": "2.2.1",
"jstimezonedetect": "1.0.7",
"jwt-decode": "2.2.0",
"lodash": "4.17.15",
"make-error": "1.3.6",
"moment": "2.26.0",
"moment-timezone": "0.5.31",
"murmurhash3js": "^3.0.1",
"nconf": "0.10.0",
"newrelic": "6.9.0",
"polished": "3.6.5",
"prop-types": "15.7.2",
"query-string": "6.13.1",
"rc-progress": "3.0.0",
"react": "16.13.1",
"react-addons-css-transition-group": "15.6.2",
"react-autosuggest": "10.0.2",
"react-count-to": "0.12.0",
"react-datepicker": "2.8.0",
"react-dom": "16.13.1",
"react-easy-crop": "3.0.1",
"react-files": "2.4.8",
"react-foundation": "0.9.6",
"react-google-invisible-recaptcha": "0.2.11",
"react-helmet": "6.1.0",
"react-hot-loader": "4.12.21",
"react-html-parser": "2.0.2",
"react-input-mask": "2.0.4",
"react-instantsearch-dom": "6.6.0",
"react-intersection-observer": "8.26.2",
"react-intl": "3.1.9",
"react-loadable": "5.5.0",
"react-markdown": "4.3.1",
"react-modal": "3.11.2",
"react-player": "1.15.0",
"react-portal": "3.1.0",
"react-rangeslider": "2.2.0",
"react-redux": "7.2.0",
"react-request": "3.1.2",
"react-responsive": "8.1.0",
"react-router-dom": "4.3.1",
"react-select": "3.1.0",
"react-slider": "1.0.8",
"react-tabs": "3.1.1",
"react-tooltip": "4.2.7",
"react-visibility-sensor": "5.1.1",
"redux": "4.0.5",
"redux-logger": "3.0.6",
"redux-promise-middleware": "6.1.2",
"redux-storage": "4.1.2",
"redux-storage-engine-localstorage": "1.1.4",
"redux-thunk": "2.3.0",
"regenerator-runtime": "0.13.5",
"request": "2.88.2",
"reselect": "4.0.0",
"serialize-javascript": "4.0.0",
"shortid": "2.2.15",
"striptags": "3.1.1",
"styled-components": "4.3.2",
"universal-cookie": "4.0.3",
"useragent": "2.3.0",
"validator": "13.1.1",
"web-video-player": "https://web-video-player.s3-us-west-2.amazonaws.com/release/web-video-player-0.9.7-RC1.tgz",
"window-or-global": "1.0.1",
"xml": "1.0.1"
},
"devDependencies": {
"@babel/cli": "7.5.5",
"@babel/core": "7.5.5",
"@babel/plugin-proposal-class-properties": "7.5.5",
"@babel/plugin-proposal-export-default-from": "7.5.2",
"@babel/plugin-proposal-export-namespace-from": "7.5.2",
"@babel/plugin-syntax-dynamic-import": "7.2.0",
"@babel/plugin-transform-modules-commonjs": "7.5.0",
"@babel/plugin-transform-react-constant-elements": "7.5.0",
"@babel/plugin-transform-react-inline-elements": "7.2.0",
"@babel/plugin-transform-regenerator": "7.10.1",
"@babel/preset-env": "7.5.5",
"@babel/preset-react": "7.0.0",
"@sambego/storybook-state": "1.3.6",
"@storybook/addon-actions": "5.1.10",
"@storybook/addon-backgrounds": "5.1.10",
"@storybook/addon-centered": "5.1.10",
"@storybook/addon-info": "5.1.10",
"@storybook/addon-links": "5.1.10",
"@storybook/addon-notes": "5.1.10",
"@storybook/addon-storysource": "5.1.10",
"@storybook/addon-viewport": "5.1.10",
"@storybook/addons": "5.1.10",
"@storybook/react": "5.1.10",
"@testing-library/jest-dom": "5.5.0",
"@testing-library/react": "10.0.6",
"@testing-library/react-hooks": "2.0.1",
"artillery": "1.6.0",
"autoprefixer": "6.7.7",
"babel-eslint": "10.0.2",
"babel-jest": "25.1.0",
"babel-loader": "8.0.6",
"babel-plugin-dynamic-import-node": "2.3.0",
"babel-plugin-lodash": "3.3.4",
"babel-plugin-react-intl": "3.0.1",
"babel-plugin-react-transform": "3.0.0",
"babel-plugin-styled-components": "1.10.6",
"babel-plugin-transform-imports": "1.5.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"btoa": "1.2.1",
"commander": "2.20.0",
"cross-env": "5.2.0",
"css-loader": "2.1.1",
"enzyme": "3.10.0",
"enzyme-adapter-react-16": "1.14.0",
"enzyme-to-json": "3.4.0",
"eslint": "5.16.0",
"eslint-config-airbnb": "17.1.1",
"eslint-config-airbnb-base": "13.2.0",
"eslint-config-prettier": "5.0.0",
"eslint-plugin-babel": "3.3.0",
"eslint-plugin-filenames-suffix": "1.2.3",
"eslint-plugin-flowtype": "2.35.0",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-prettier": "3.1.0",
"eslint-plugin-react": "7.14.3",
"eslint-plugin-react-hooks": "1.7.0",
"eventsource-polyfill": "0.9.6",
"fetch-mock": "8.0.0",
"file-loader": "1.1.6",
"flat": "2.0.1",
"git-pre-hooks": "1.2.1",
"glob": "7.1.4",
"husky": "2.4.1",
"identity-obj-proxy": "3.0.0",
"image-webpack-loader": "4.5.0",
"imagemin-webp-webpack-plugin": "3.2.1",
"jest": "25.1.0",
"jest-canvas-mock": "2.1.0",
"jest-css-modules-transform": "2.5.0",
"jest-environment-jsdom": "25.1.0",
"jest-environment-jsdom-global": "1.2.1",
"jest-localstorage-mock": "2.4.0",
"jest-styled-components": "6.3.3",
"jquery": "3.5.1",
"lint-diff": "1.2.1",
"lint-staged": "8.2.1",
"mini-css-extract-plugin": "0.4.4",
"mockdate": "2.0.5",
"motion-ui": "2.0.3",
"ncp": "2.0.0",
"node-sass": "4.14.1",
"node-sass-utils": "1.1.2",
"optimize-css-assets-webpack-plugin": "5.0.3",
"postcss-discard-duplicates": "2.1.0",
"postcss-flexbugs-fixes": "3.2.0",
"postcss-loader": "2.0.10",
"pre-commit": "1.2.2",
"prettier": "1.18.2",
"react-storybook-addon-chapters": "3.1.5",
"react-test-renderer": "16.9.0",
"redux-mock-store": "1.5.3",
"resolve-url-loader": "3.1.0",
"rimraf": "2.6.3",
"sass-loader": "6.0.6",
"sitemap-stream-parser": "1.7.0",
"sqip": "0.3.3",
"storybook-addon-intl": "2.4.1",
"storybook-react-router": "1.0.5",
"style-loader": "0.19.1",
"stylelint": "9.10.1",
"stylelint-config-recommended": "2.2.0",
"stylelint-config-styled-components": "0.1.1",
"stylelint-processor-styled-components": "1.8.0",
"terser-webpack-plugin": "1.4.1",
"tmp": "0.0.33",
"url": "0.11.0",
"url-loader": "2.1.0",
"webpack": "4.39.1",
"webpack-bundle-analyzer": "3.8.0",
"webpack-cli": "3.3.6",
"webpack-dev-middleware": "3.7.0",
"webpack-hot-middleware": "2.25.0",
"webpack-manifest-plugin": "2.0.4",
"webpack-node-externals": "1.7.2"
},
"config": {
"unsafe-perm": true
},
}
任何建议都将受到赞赏
答案 0 :(得分:1)
如果构建耗时超过10m而没有输出,则会发生这种情况。
您可以按照文档GCP docs
每分钟使用travis_wait
到控制台打印一些内容。
travis_wait {your_command}
就可以了,您应该很好。
请注意,建造时间超过10m可能表明存在更复杂的潜在问题/冻结。