''npm run watch' or 'dev' not working anymore in my computer (Laravel project), Error : '[webpack-cli] RangeError: Maximum call stack size exceeded'

I have been working on a website (using Laravel) recently, and since yesterday I have been working on JavaScript code (to implement Meilisearch).

For this, I recently added the 'dotenv' library with node, because I need to get a variable in my .env file for the security key.

But today, after modifying the code, I did npm run dev and npm run watch but neither worked:\ The error message is this:\

[webpack-cli] RangeError: Maximum call stack size exceeded
at RegExp.exec ()
at C:\ ... \ ...\project\node_modules\dotenv-expand\lib\main.js:11:49
at Array.reduce ()
at interpolate (C:\ ... \ ...\project\node_modules\dotenv-expand\lib\main.js:10:20)
at C:\ ... \ ...\project\node_modules\dotenv-expand\lib\main.js:26:17
at Array.reduce ()
at interpolate (C:\ ... \ ...\project\node_modules\dotenv-expand\lib\main.js:10:20)
at C:\ ... \ ...\project\node_modules\dotenv-expand\lib\main.js:26:17
at Array.reduce ()
at interpolate (C:\ ... \ ...\project\node_modules\dotenv-expand\lib\main.js:10:20)

Error message in VScode

I don't understand what the problem is here, especially because it seems to be only on my computer that it does that (I tried running the command with an other computer and it doesn't display this error).

Do you guys have an idea of what the problem could be?



Solution 1:[1]

Try deleted your node_modules folder and then running NPM install and NPM run dev.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 IBeThieving