benjamn / ast-types

Esprima-compatible implementation of the Mozilla JS Parser API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm install fails due to conflicting peer dependency

andersk opened this issue · comments

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.

$ 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.)