Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Terminal keeps giving error: 'node: --experimental-workerexport is not allowed in NODE_OPTIONS'

Tags:

node.js

macos

My terminal on Mac (Osx 10.15.1) keeps giving me:

node: --experimental-workerexport is not allowed in NODE_OPTIONS

It doesn't matter which folder I'm in, it always gives me this error if I try to do something with Node.

Node version: v13.6.0 / NVM version: 0.35.2

like image 929
Max B Avatar asked Oct 14 '25 14:10

Max B


1 Answers

Someone somewhere has set environment variable NODE_OPTIONS to something like

NODE_OPTIONS='--experimental-workerexport'

The list of options allowed in NODE_OPTIONS is limited: https://nodejs.org/dist/latest-v16.x/docs/api/cli.html#cli_node_options_options

When Node.js starts and encounters disallowed option, it complains and exits.

There are two possible situations:

  1. Environment variable is just exported once and not persisted. Restarting OS will help.
  2. Environment variable is set every time after restart (e.g. in ~/.bashrc). You should find where NODE_OPTIONS is set and remove any disallowed options from it.
like image 106
Victor Avatar answered Oct 17 '25 17:10

Victor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!