Skip to content

Error when using Lerna 3.0 #405

Closed
Closed
@backflip

Description

@backflip

When using Commitlint in a monorepo with Lerna 3.0.0-rc.0, the following error occurs:

Error: Cannot find module 'lerna/lib/Repository'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at resolveFileName (node_modules/resolve-from/index.js:17:39)
    at resolveFrom (node_modules/resolve-from/index.js:31:9)
    at module.exports (node_modules/resolve-from/index.js:34:41)
    at module.exports (node_modules/import-from/index.js:4:49)
    at getPackages (node_modules/@commitlint/config-lerna-scopes/index.js:14:21)
    at scope-enum (commitlint.config.js:10:41)
    at Object.<anonymous> (node_modules/@commitlint/execute-rule/lib/index.js:23:27)
    at new Promise (<anonymous>)
    at Object.<anonymous> (node_modules/@commitlint/execute-rule/lib/index.js:21:25)

Expected Behavior

As soon as Lerna 3 is stable, https://github.com/marionebl/commitlint/tree/master/%40commitlint/config-lerna-scopes should be updated to work with it.

Current Behavior

The current code in https://github.com/marionebl/commitlint/tree/master/%40commitlint/config-lerna-scopes is not compatible with Lerna 3.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

Figure out how Lerna 3 exposes package names.

Steps to Reproduce (for bugs)

  1. Have a working monorepo using Lerna 2.
  2. Bump Lerna to 3
  3. See above error

Context

I want to be able to update a Lerna monorepo to v3.

Your Environment

Executable Version
commitlint --version 7.0.0
git --version 2.15.2
node --version 10.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions