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

Viewed 11972

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/fontawesome-free@5.15.4
├── @tailwindcss/forms@0.3.4
├── @tailwindcss/typography@0.4.1
├── alpinejs@3.4.2
├── axios@0.21.4
├── laravel-mix@6.0.35
├── lodash@4.17.21
├── postcss-import@14.0.2
├── postcss@8.3.11
├── resolve-url-loader@4.0.0
├── sass-loader@12.3.0
├── sass@1.43.4
├── sweetalert2@11.1.9
└── tailwindcss@2.2.17

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 npm@8.1.2 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/fontawesome-free@5.15.4
├── @tailwindcss/forms@0.3.4
├── @tailwindcss/typography@0.4.1
├── alpinejs@3.5.0
├── axios@0.21.4
├── laravel-mix@6.0.39
├── lodash@4.17.21
├── postcss-import@14.0.2
├── postcss@8.3.11
├── resolve-url-loader@4.0.0
├── sass-loader@12.3.0
├── sass@1.43.4
└── tailwindcss@2.2.19

and it's working normally again!

2 Answers
Related