Repository navigation
Destruction of TypeScript ecosystem on npm is expanding #32273
Description
Activity
- addedNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.
on Jul 10, 2019 falsandtru commented
on Jul 10, 2019 ContributorAuthorMore actionsMy proposal is #18588 (comment). You just implement it.
I believe that the best option is to just use pnpm, which doesn’t have this problem, as packages are stored in isolated trees and are symlinked to each other.
pnpm file hierarchy for
del@4.1.1:
(only relevant Types (@types) packages are included)node_modules/ - del - .registry.npm.com/del/4.1.1/node_modules/del - .registry.npmjs.com/ - @types/ - glob/ - <version>/ - node_modules/ - @types/ - glob/ - node - ../../../../../@types/node/<version>/node_modules/@types/node - node/ - del/ - 4.1.1/ - node_modules/ - del/ - @types/ - glob - ../../../../../@types/glob/<version>/node_modules/@types/globTypeScript only looks into
node_modules/@types/, not intonode_modules/.registry.npmjs.com/@types/<package>/<version>/node_modules/@types/Reacted by Sebastian Busch and Jack WorksExE Boss (@ExE-Boss), hello. I came to this ticket by the opposite reason. I'm already using pnpm actively in my non-TS projects. However, when I try to install
@typespackage in pnpm (with classic deps tree hierarchy) tsc rejects to resolve transient dependencies of such@typespackages. Just to check my guess, I tried reinstalling with vanilla npm (flat deps). From that point tsc works OK, which means no errors in my typed code. However when I switch back withpnpm installtsc starts to nag again, like:node_modules/@types/express/index.d.ts:19:23 - error TS2307: Cannot find module 'express-serve-static-core'. 19 import * as core from "express-serve-static-core";(I depend on
@types/express).
Have you faced similar issues (in past or present)? Is it my own issue which I should investigate further or tsc now hard depends on flat order of dependecies?Reacted by Eric BartelsLooks like my issue is #30858, but not sure.
As I mentioned at #31148, unused Types (@types) files installed by node modules pollutes and breaks the main project. It is caused by del package at that time. Now this problem came to be spread by another major package npm-check-updates. This means the destruction of ecosystem is expanding. TypeScript must resolve the problem quickly. See a solution #18588 (comment).