Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

npm run prod not working #14

@HeytalePazguato

Description

@HeytalePazguato

I am not sure what is wrong but when I do npm run dev it compiles and it works but when I try with npm run prod I get the following errors:

-bash-4.2$ npm run prod

> prod
> npm run production


> production
> mix --production


● Mix █████████████████████████ sealing (92%) asset processing
 RealContentHashPlugin

node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: spawn /home/xxxxxxxxxx/.nvm/versions/node/v16.19.0/bin/node EAGAIN
    at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:485:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
    at onErrorNT (node:internal/child_process:485:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -11,
  code: 'EAGAIN',
  syscall: 'spawn /home/xxxxxxxxxx/.nvm/versions/node/v16.19.0/bin/node',
  path: '/home/xxxxxxxxxx/.nvm/versions/node/v16.19.0/bin/node',
  spawnargs: [
    '/home/xxxxxxxxxx/domains/grupocengall.com/public_html/node_modules/rollup-plugin-terser/node_modules/jest-worker/build/workers/processChild.js'
  ]
}
-bash-4.2$

My webpack.mix.js is:

const mix = require('laravel-mix');

require('laravel-mix-workbox');
/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel applications. By default, we are compiling the CSS
 | file for the application as well as bundling up all the JS files.
 |
 */

mix
    .js('resources/js/app.js', 'public/js')
    .sass('resources/scss/app.scss', 'public/css')
    .webpackConfig({
        output: {
            publicPath: ''
        }
    })
    .generateSW({
        exclude: [
            'mix.js'
        ],
        runtimeCaching: [{
            urlPattern: /\.(?:png|jpg|jpeg|svg|webp)$/,
            handler: 'CacheFirst',
            
        }],
        clientsClaim: true,
        skipWaiting: true
        
    })
    .sourceMaps(false);

if (mix.inProduction()) {
    mix.version();
}

If I delete the generateSW section then it can successfully complete the process so there might be a parameter I am missing. Can anyone help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions