skyrpex / laravel-nuxt-js

Build a SPA with Laravel and Nuxt.
https://www.npmjs.com/package/laravel-nuxt
MIT License
146 stars 20 forks source link

Added NODE_OPTS environment to add extra node arguments when using laravel-nuxt-dev.js #32

Closed dfaldana closed 4 years ago

dfaldana commented 4 years ago

This change to allow to pass parameters to the node executable when setting the environment variable NODE_OPTS.

For example, to workaround a limitation of the Header size we would use:

NODE_OPTS='--max-http-header-size=80000' laravel-nuxt dev

Thanks,

skyrpex commented 4 years ago

Sorry about the delay!

The node process is already inheriting the environment variables, so you can already do NODE_OPTIONS="--max-http-header-size=80000" yarn laravel-nuxt dev or NODE_OPTIONS="--max-http-header-size=80000" npm run dev.

Please, note that the variable is named NODE_OPTIONS, not NODE_OPTS.

If that doesn't work, don't hesitate to open the issue again.

arodriguez-inbenta commented 4 years ago

It seems that for some reason node doesn't accept this option. node: --max-http-header-size=80000 is not allowed in NODE_OPTIONS Do you know why it can be?

skyrpex commented 4 years ago

Can you run these snippets and put the output here?

node -v
echo "" | node --max-http-header-size=80000
echo "" | node --max-http-hea=80000
echo "" | NODE_OPTIONS='--max-http-header-size=8000' node
dfaldana commented 4 years ago

Hello:

Indeed, it works correctly changing package.json, in the "start" script:

"start": "NODE_OPTIONS=\"--max-http-header-size=80000\" laravel-nuxt dev"

Thank, you.