NX Can't find a root directory while resolving a config file path

459 Views Asked by At

I'm running the following command: nx test --project=<my_lib_name>
and gets the following error:

"NX Can't find a root directory while resolving a config file path"

1

There are 1 best solutions below

0
On

SOLVED:

my problem was that i've changed the library directory after i've created the library

OLD:

// project.json

   "options": {
      "jestConfig": "libs/my_lib_name/jest.config.ts",
       ...
      }

// jest.config.ts

export default {
    preset: '../../jest.preset.js',
    ...
    }

NEW:

// project.json

"options": {
   "jestConfig": "libs/feature-libraries/my_lib_name/jest.config.ts",
     ...
 }

// jest.config.ts

   export default {
      preset: '../../../jest.preset.js',
      ...
    }