0

When a Lerna command fails (calling lerna add <package> lerna bootstrap), the project may break and experience some of the following issues:

  • Project folders erased
  • Compile (tsc) errors like File '/<home>/<project>/packages/<chaincode>-cc/src/<controller-name>.controller.ts' is not under 'rootDir' '/<home>/<project>/packages/<chaincode>-cc/src/'. 'rootDir' is expected to contain all source files.

It's a Lerna issue but may affect Convector CLI generated projects, since it's a dependency.

1 Answers1

0

It usually happens when a package is imported incorrectly (it may happen due to automatically importing packages with VS Code, which usually set the packages wrong)

For example:

import { <controller>Controller } from '../../../<controller>-cc/src';

This will throw errors when trying to resolve packages.

The way to solve it is by fixing the import path like:

import { <controller>Controller } from '<controller>-cc';

Then clean things and refresh packages.

lerna clean
# Remove the root node_modules folder
npm i