postinstall runs 35 nested installs when used as a dependency, which consumers don't need

オープン 初心者向け
#825 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@aelmanaa がすでに取り組んでいます。

2026年10月31日 から。

  • #826 @aelmanaa による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
70/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript, node.js
領域
build-system

調査の方向性

postinstall のロジックは npm/deepinstall.js にあります。そこから始めて、35 の codegen フォルダーをどうループするかを見てください。パッケージがチェックアウトで開発されている場合 (例: ローカルの .git や dev スクリプトの呼び出しを確認) を除き、ネストされたインストールがスキップされるようにガードを追加してください。Done とは、パッケージを依存関係としてインストールしても 35 のインストールがトリガーされず、node_modules のサイズが小さいままになることを意味します。

索引モデルが issue の本文から書いたものです。

説明

Describe the bug
When postman-code-generators is installed as a dependency, the postinstall script (npm/deepinstall.js) runs a nested npm/yarn/pnpm install in each of the 35 codegen folders. Consumers don't need it: the codegens' runtime dependencies (lodash, postman-collection) are already dependencies of the root package and resolve from there, and lib/assets/languages.js is generated by prepack and published.

To Reproduce
npm i [email protected] in an empty project, with yarn 1 installed globally:

  • the script detects yarn (see #792) and runs yarn install --production --frozen-lockfile 35 times
  • node_modules/postman-code-generators grows from 3.0 MB to 97 MB
  • the step needs network access, and pnpm and npm 11 flag it as an install script that needs approval

With npm i --ignore-scripts [email protected] instead, every variant from getLanguageList() (35 across 21 languages) converts the same request to a byte-identical snippet.

Expected
No nested installs when installed as a dependency. They are only needed when developing this repo (npm install / npm run deepinstall in a checkout).

Related: #792, #806 (package manager detection). Skipping the step for consumers would avoid that detection path for them entirely.

主要言語
JavaScript
スター
1k
フォーク
382
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

postmanlabs/postman-code-generators のほかの issue

postmanlabs/postman-code-generators の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。