Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel TALL npm run dev --openssl-legacy-provider is not allowed in NODE_OPTIONS

I have just updated the npm packages of my Laravel project right at my MacOS system (I have been developing on Laravel Homestead since so long but npm didn't work for me),

% npm list

% npm update -D

% npm list to compare the versions differences

% npm install

also brew update and brew upgrade (on MacOS).

So I got now the following versions:

% npm -v: 8.1.0

├── @fortawesome/[email protected]
├── @tailwindcss/[email protected]
├── @tailwindcss/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

When I run $ npm run dev nothing happens and I get the following message:

% npm run dev

> dev
> npm run development


> development
> mix

node: --openssl-legacy-provider is not allowed in NODE_OPTIONS

What do I do to fix it?

Workaround

I ran $ npm run dev right inside the Ubuntu Laravel Homestead and it worked! At the end I got the following messages:

webpack compiled successfully
npm notice
npm notice New major version of npm available! 7.12.1 -> 8.1.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.1.2
npm notice Run npm install -g [email protected] to update!
npm notice

But I won't update, since I'm afraid I'll get the same error.

Notice:

% => I am running on MacOS.

$ => I am running on Ubuntu.

Update

I have just updated again everything with

% brew update
% brew upgrade

Then I ran again

% npm run dev even if I still got npm -v => 8.1.0, but my packages have been updated:

├── @fortawesome/[email protected]
├── @tailwindcss/[email protected]
├── @tailwindcss/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

and it's working normally again!

like image 211
Pathros Avatar asked Nov 06 '22 00:11

Pathros


2 Answers

For me the cause was node version 17.

I downgraded node to version 16 (LTS) and it worked.

See also the answer here https://stackoverflow.com/a/70286141/936284

like image 94
Alexander Taubenkorb Avatar answered Dec 06 '22 03:12

Alexander Taubenkorb


unset NODE_OPTIONS

worked for me

like image 29
Sourabh Das Avatar answered Dec 06 '22 02:12

Sourabh Das