Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internal/modules/cjs/loader.js: 584 error

I am facing an error when I am running npm commands for running a umi app project. This is the error I see when I run the code.

I have tried checking the node module for the loader.js file but I have not been able to find it.

internal/modules/cjs/loader.js:584
    throw err;
    ^

Error: Cannot find module '@nodelib/fs.stat'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\cyhc9\umiapp\node_modules\fast-glob\out\adapters\fs-stream.js:17:14)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)

The code should run when I run npm commands or the project commands.

like image 904
Caleb Yang Avatar asked Mar 20 '26 08:03

Caleb Yang


1 Answers

Possible solutions:

  1. Try not to have space in your directory name, i.e.: fun project/nestjs/..., try this: fun-project/nestjs/....
  2. Remove node_modules and package-lock.json then do npm install again to see if that solve the problem.
  3. Clear node cache by npm cache clean --force then repeat step number 2.
  4. Keep trying npm i again.
  5. Buy a new computer.

Good luck.

like image 181
Mr. Dang Avatar answered Mar 21 '26 22:03

Mr. Dang



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!