Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

Can dependencies of the npm installer be smaller? #231

Open
evancz opened this issue Apr 17, 2018 · 1 comment
Open

Can dependencies of the npm installer be smaller? #231

evancz opened this issue Apr 17, 2018 · 1 comment
Labels

Comments

@evancz
Copy link
Contributor

evancz commented Apr 17, 2018

I ran npm install [email protected] today, and it has a lot of transitive dependencies:

└─┬ [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ ├─┬ [email protected] 
  │ │ └─┬ [email protected] 
  │ │   ├── [email protected] 
  │ │   ├── [email protected] 
  │ │   ├── [email protected] 
  │ │   ├── [email protected] 
  │ │   └── [email protected] 
  │ ├── [email protected] 
  │ ├─┬ [email protected] 
  │ │ └── [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ ├─┬ [email protected] 
  │ │ └─┬ [email protected] 
  │ │   └── [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ ├─┬ [email protected] 
  │ │ │ │ └── [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ └── [email protected] 
  │ │ ├── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ ├─┬ [email protected] 
  │ │ │ │ └── [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ └── [email protected] 
  │ │ └─┬ [email protected] 
  │ │   └── [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├── [email protected] 
  │ │ ├── [email protected] 
  │ │ ├── [email protected] 
  │ │ └── [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├── [email protected] 
  │ │ ├─┬ [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ ├── [email protected] 
  │ │ │ └─┬ [email protected] 
  │ │ │   └── [email protected] 
  │ │ └─┬ [email protected] 
  │ │   ├── [email protected] 
  │ │   ├── [email protected] 
  │ │   ├── [email protected] 
  │ │   ├─┬ [email protected] 
  │ │   │ └── [email protected] 
  │ │   ├── [email protected] 
  │ │   ├─┬ [email protected] 
  │ │   │ └── [email protected] 
  │ │   ├── [email protected] 
  │ │   └── [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ ├─┬ [email protected] 
  │ │ └── [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ ├─┬ [email protected] 
  │ │ └── [email protected] 
  │ └── [email protected] 
  └─┬ [email protected] 
    ├── [email protected] 
    ├─┬ [email protected] 
    │ ├── [email protected] 
    │ └─┬ [email protected] 
    │   └─┬ [email protected] 
    │     ├── [email protected] 
    │     ├─┬ [email protected] 
    │     │ └── [email protected] 
    │     ├─┬ [email protected] 
    │     │ └─┬ [email protected] 
    │     │   ├── [email protected] 
    │     │   └── [email protected] 
    │     ├── [email protected] 
    │     └── [email protected] 
    └── [email protected] 

Is it possible to get rid of the direct dependency on request? That would help a lot, and my instinct is that whatever we need to do can be done with XMLHttpRequest directly. Maybe the redirect stuff wouldn't be easy though. Not sure!

@evancz evancz added the npm label Apr 17, 2018
@rofrol
Copy link

rofrol commented Apr 17, 2018

Looks like binstall is using it:

installers/npm/package-lock.json

    "binstall": {
      "version": "1.2.0",
      "resolved": "https://registry.npmjs.org/binstall/-/binstall-1.2.0.tgz",
      "integrity": "sha1-aywPWAuePGB/UO96IqVM6f3I2TM=",
      "requires": {
        "request": "2.79.0",
        "tar": "2.2.1"
      }
    },

and we use it here:

installers/npm/install.js

binstall(url, {path: binariesDir, strip: 1},
  {verbose: true, verify: executablePaths, errorMessage: errorMessage}
).then(function(successMessage) {
    console.log(successMessage);
  }, function(errorMessage) {
    console.error(errorMessage);
    process.exit(1);
  });

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants