Search code examples
reactjsnpmbamboo

Cannot Find RequestPath Module isexe


I am running npm run test:CI (jest-html-reporter) in Bamboo CI but this error occurred:

> node:internal/modules/cjs/loader:361
throw err;
^
Error: Cannot find module 'C:\...\node_modules\isexe\index.js'. 
Please verify that the package.json has a valid "main" entry

path: '...node_modules\\isexe\\package.json',
requestPath: 'isexe'
code: 'MODULE_NOT_FOUND'

The main in my package.json is set to 'dist/index.js'

What is this error and how can I resolve it?


Solution

  • Can you try to clean the cache:

    npm cache clean
    

    If it doesn't work try:

    npm cache clean --force
    

    Also, I cannot see your folder structure, but I think the route is: './dist/index.js', not 'dist/index.js'.