Laravel-mix `npm run production` hangs at "91% additional asset processing" then exits to command line
See original GitHub issue- Laravel Mix Version: 1.0.6
- Node Version: 6.11.0
- NPM Version: 5.0.3
- OS: Ubuntu Server 16.04.2 LTS
Description:
During my application’s deploy process, running npm run production
causes laravel-mix
and/or webpack
to hang at 91% additional asset processing
, and then exits to the command line without completing asset compilation. This issue has been mentioned on the webpack issue tracker and has been closed, but I can’t seem to figure out what the actual solution is for a laravel-mix
user, aside from updating everything to the latest version(s) which did not seem to help. I believe this is occurring because I have a very large SPA project with many Vue components and it is running out of memory while minifying/concatenating everything. (Running npm run dev
works fine.) I don’t know enough about webpack
personally, I just use laravel-mix
.
Steps To Reproduce:
-
Large single-page-app project with lots of Vue components and
vue-router
. (Sorry I cannot provide this.) -
Use the following
package.json
file:
{
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development webpack --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"hot": "cross-env NODE_ENV=development webpack-dev-server --watch-poll --inline --hot --output-public-path http://myapp.local/ --host myapp.local --config=node_modules/laravel-mix/setup/webpack.config.js",
"production": "cross-env NODE_ENV=production webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.15.2",
"bootstrap": "^3.3.7",
"bootstrap-sass": "^3.3.7",
"jquery": "^3.2.1",
"laravel-mix": "^1.0.3",
"lodash": "^4.16.2",
"pusher-js": "^4.0.0",
"select2": "^4.0.3",
"vue": "^2.2.6",
"vue-multiselect": "^2.0.0-beta.15",
"vue-resource": "^1.3.1",
"vue-router": "^2.4.0"
},
"dependencies": {
"cross-env": "^5.0.1",
"laravel-echo": "^1.3.0",
"moment": "^2.18.1",
"moment-timezone": "^0.5.13",
"rrule": "^2.2.0",
"webpack": "^3.0.0"
},
"peerDependencies": {
"webpack": "^2.2.0"
}
}
- Then run
npm run production
to compile all assets.
As a side note, the package.json
file above also gives me issues with unmet peer dependencies when I run npm list --depth=0
. I see an UNMET PEER DEPENDENCY
for webpack@3.0.0
but also npm ERR! peer dep missing: webpack@^2.2.0
for multiple other packages. This is why I was trying to include them both somehow, but I don’t know how to install multiple versions of webpack the correct way to meet these peer dependencies.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:8 (3 by maintainers)
Top GitHub Comments
@shorlbeck It happened to me on my production server where I only had 512MB of RAM. I added a 2 GB swapfile and the compiling continued past
91% additional asset processing
.Might be related: https://www.digitalocean.com/community/questions/npm-gets-killed-no-matter-what
Anyone coming back to this page, I can confirm creating swapfile fixed the problem for me.
OS: Ubuntu 18.04.3 LTS Node: 10.17.0 NPM: 6.11.3 Laravel-mix: 2.1.14
RAM: 4GB Swap: 4GB