Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

507
Views
Error: Cannot find module './lib/compilers' with npm

I had to install Nodejs/npm to debug and test some code, for some coding exercises in JavaScript.

But, when typing npm test filename.spec.js in my debugger terminal, the test did not launch.

I had the following output instead :

    Error: Cannot find module './lib/compilers'
Require stack:
- /home/tbatou/Téléchargements/javascript-exercises/node_modules/nanomatch/index.js
- /home/tbatou/Téléchargements/javascript-exercises/node_modules/sane/node_modules/micromatch/lib/compilers.js
- /home/tbatou/Téléchargements/javascript-exercises/node_modules/sane/node_modules/micromatch/index.js
- /home/tbatou/Téléchargements/javascript-exercises/node_modules/sane/node_modules/anymatch/index.js
- /home/tbatou/Téléchargements/javascript-exercises/node_modules/sane/src/common.js
- /home/tbatou/Téléchargements/javascript-exercises/node_modules/jest-haste-map/build/lib/WatchmanWatcher.js
- /home/tbatou/Téléchargements/javascript-exercises/node_modules/jest-haste-map/build/index.js
- /home/tbatou/Téléchargements/javascript-exercises/node_modules/jest-runtime/build/index.js
- /home/tbatou/Téléchargements/javascript-exercises/node_modules/@jest/core/build/cli/index.js
- /home/tbatou/Téléchargements/javascript-exercises/node_modules/@jest/core/build/jest.js
- /home/tbatou/Téléchargements/javascript-exercises/node_modules/jest/node_modules/jest-cli/build/cli/index.js
- /home/tbatou/Téléchargements/javascript-exercises/node_modules/jest/node_modules/jest-cli/bin/jest.js
- /home/tbatou/Téléchargements/javascript-exercises/node_modules/jest/bin/jest.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/tbatou/Téléchargements/javascript-exercises/node_modules/nanomatch/index.js:15:17)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1028:19)

(/Téléchargements (french) stands for /Downloads)

As I've encountered some with the similar issue, It was not with the same config/device neither with the same node module involved. Would anyone have a clue here ?

What I use

  • Ubuntu 22.04.1 LTS
  • GNOME 42.4
  • 64 Bits
  • npm version : 8.19.2
almost 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!