Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module not found: Can't resolve 'async_hooks'

Failed to compile.

./node_modules/vm2/lib/resolver-compat.js
Module not found: Can't resolve 'async_hooks' in \node_modules\vm2\lib'
Error from chokidar (E:\node_modules): Error: EBUSY: resource busy or locked, lstat 'E:\pagefile.sys'
Error from chokidar (E:\node_modules): Error: EBUSY: resource busy or locked, lstat 'E:\pagefile.sys'

When I try to run my app(react), suddently this errors showed up, and even reinstalling the node modules won't work, I tried to reinstall node and webpack too and neither worked.

like image 368
LDrof Avatar asked Jun 11 '26 19:06

LDrof


1 Answers

I have fixed the issue by adding the following fallback in the webpack 5 configuration file

 resolve: {
  
  fallback: {
   
    async_hooks: false,
  },
}
like image 73
mshameer Avatar answered Jun 13 '26 07:06

mshameer



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!