Skip to content

Destruction of TypeScript ecosystem on npm is expanding #32273

Description

@falsandtru

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

Activity

  1. falsandtru commented on Jul 10, 2019

    @falsandtru
    ContributorAuthor

    My proposal is #18588 (comment). You just implement it.

  2. ExE-Boss commented on Jul 22, 2019

    @ExE-Boss
    Contributor

    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/glob
    

    TypeScript only looks into node_modules/@types/, not into node_modules/.registry.npmjs.com/@types/<package>/<version>/node_modules/@types/

  3. StreetStrider commented on Aug 11, 2019

    @StreetStrider

    ExE 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 @types package in pnpm (with classic deps tree hierarchy) tsc rejects to resolve transient dependencies of such @types packages. 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 with pnpm install tsc 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?

  4. StreetStrider commented on Aug 11, 2019

    @StreetStrider

    Looks like my issue is #30858, but not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions