benjamn / benjamn/ast-types

npm install fails due to conflicting peer dependency

Open
#768 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.2k
Forks
194
Avg merge
22h 43m
Merged PRs (30d)
10

Description

`ts-emit-clean` has a peer dependency on `typescript@^3.0.0` that conflicts with our devDependency on `typescript@4.5.2`. This breaks `npm install`.

```console
$ git clone https://github.com/benjamn/ast-types.git

$ cd ast-types

$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: ts-emit-clean@1.0.0
npm ERR! Found: typescript@4.5.2
npm ERR! node_modules/typescript
npm ERR! dev typescript@"4.5.2" from the root project
npm ERR! peer typescript@">=2.7" from ts-node@10.4.0
npm ERR! node_modules/ts-node
npm ERR! dev ts-node@"10.4.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer typescript@"^3.0.0" from ts-emit-clean@1.0.0
npm ERR! node_modules/ts-emit-clean
npm ERR! dev ts-emit-clean@"1.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: typescript@3.9.10
npm ERR! node_modules/typescript
npm ERR! peer typescript@"^3.0.0" from ts-emit-clean@1.0.0
npm ERR! node_modules/ts-emit-clean
npm ERR! dev ts-emit-clean@"1.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/anders/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/anders/.npm/_logs/2022-05-25T21_45_28_938Z-debug-0.log

$ node --version
v16.15.0

$ npm --version
8.10.0
```

(Also affects recast. I won’t bother filing a separate issue unless you want one.)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with npm install using Node v16.15.0 and npm 8.10.0, then inspect the dependency declarations for ts-emit-clean and TypeScript. Resolve the peer-dependency conflict without --force or --legacy-peer-deps, and verify that installation completes; check whether the same dependency issue affects recast.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
build-system, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.