question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

unsatisfied peer-dependency on typescript in v13.2.0 of `@commitlint/cli`

See original GitHub issue

Expected Behavior

running npm ls with @commitlint/cli installed should exit zero, meaning that there are no unsatisfied peer dependencies in the dependency tree.

Current Behavior

npm ls reports an unsatisfied peer dependency on typescript:

npm ERR! peer dep missing: typescript@>=2.7, required by ts-node@9.1.1

npm ls ts-node shows that the requirement is pulled in by @endemolshinegroup/cosmiconfig-typescript-loader:

  └─┬ @commitlint/cli@13.2.0
    └─┬ @commitlint/load@13.2.0
      └─┬ @endemolshinegroup/cosmiconfig-typescript-loader@3.0.2
        └── ts-node@9.1.1 

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

either make @endemolshinegroup/cosmiconfig-typescript-loader an optional peer dependency or define typescript as a direct dependency of the cli package in order to satisfy the peer requirement.

Steps to Reproduce (for bugs)

  1. npm install @commitlint/cli -D
  2. npm ls

Context

i use commitlint in many projects that are not typescript projects, so i do not want to define typescript as a direct dependency in those projects to satisfy a peer requirement of commitlint.

Your Environment

Executable Version
commitlint --version 13.2.0
git --version 2.27.0
node --version 14.17.5
npm --version 6.14.14

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
travicommented, Sep 30, 2021

Ah, then it’s not really our issue?

by choosing to include @endemolshinegroup/cosmiconfig-typescript-loader as a dependency, i think it becomes your issue, unfortunately. i do believe it would be better for the fix to be applied to their package directly, it looks like that has become stalled, leaving the unsatisfied peer requirement in your dependency tree.

the same fix that has been proposed in the PR against @endemolshinegroup/cosmiconfig-typescript-loader could be included here to satisfy the requirement at this level. if the problem is resolved directly in @endemolshinegroup/cosmiconfig-typescript-loader, the more local fix could be reverted at that point.

if you are open to that path forward, i would be happy to send a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix the npm UNMET PEER DEPENDENCY ...
UNMET PEER DEPENDENCY error is thrown when the dependencies of one or more ... So my typescript needs to be between 2.4.2 and...
Read more >
ts-jest | Yarn - Package Manager
A Jest transformer with source map support that lets you use Jest to test projects written in TypeScript. NPM version NPM downloads Known...
Read more >
commitlint/cli
Lint your commit messages. Latest version: 17.3.0, last published: a month ago. Start using @commitlint/cli in your project by running `npm ...
Read more >
Files changed (37) - Renovate Bot Package Diff
node 6 unhappy again. ... peer dependency against Typescript 2.x ... -13,11 +22,9 @@ It supports all features of TypeScript including type-checking.
Read more >
commitlint
unsatisfied peer-dependency on typescript in v13.2.0 of `@commitlint/cli`. lingzan. lingzan CLOSED · Updated 1 year ago ... Updated 2 months ago ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found