Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run prod not working #14

Open
HeytalePazguato opened this issue Dec 21, 2022 · 0 comments
Open

npm run prod not working #14

HeytalePazguato opened this issue Dec 21, 2022 · 0 comments

Comments

@HeytalePazguato
Copy link

HeytalePazguato commented Dec 21, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant