Search code examples
javascriptnpmlernamonorepo

running test command using lerna managed monorepo using --scope fails


I'm using lerna to manage my monorepo, for some reason, when I try to run the following command from the root folder (using the docs here): lerna run --scope my-app test I get the following error of lerna didn't find the module to run npm test on:

lerna notice cli v3.20.2
lerna info versioning independent
lerna notice filter including "my-app"
lerna info filter [ 'my-app' ]
lerna ERR! EFILTER No packages remain after filtering [ 'my-app' ]

My lerna.json file has this definitions:

"packages": [
    "app1",
    "some-package-with-my-app/*",
    "app2",
    "app3"
  ],

I also tried to run lerna run --scope some-package-with-my-app/my-app test but got the same error (with the corresponding filter name, of course)

What am I doing wrong? Am I missing something in the docs?


Solution

  • The package named my-app was scoped with my organisation name. i.e. the name as appeared in my package.json file was @org/my-app so once running lerna run --scope @org/my-app test it worked perfectly