npm i --global-style
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- javascript, node.js
- 領域
- tooling
調査の方向性
エントリーポイントとして dependency-tree から始め、dist/src/index.js、dist/node_modules/package2/index.js、およびレポートに示されているネストされた package1 のパスを使って呼び出しを再現します。結果を Node.js のモジュール解決動作と比較し、ディレクトリ引数とファイル名引数がどのように解決されるかを追跡します。期待される出力で説明されている、最も近いネストされた node_modules レイアウトが依存関係ツリーに反映されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Hello!
Maybe I'm creating an issue in the wrong repository and real problem hides somewhere in dependencies. But I use dependency-tree as an entry point, so ... it looks like a good start.
Let's imagine that we have the following directory layout:
<project>
|
- package.json
- node_modules
| |
| - package1
| |
| - index.js
|
- dist <- dependency-tree `directory` argument
|
- package.json
- src
|
- index.js <- dependency-tree `filename` argument (path.join(..., 'dist', 'src', 'index.js'))
- node_modules
|
- package2
|
- index.js
- node_modules
|
- package1
|
- index.js
I invoke dependency-tree with the following arguments:
{
directory: path.join(<project>, 'dist'),
filename: path.join(<project>, 'dist/src/index.js')
}
And index.js requires package2 module. Which, respectively, requires package1 module. The folder where package2 resides was initiated by the following command: npm i --global-style, i.e. dependencies of modules from package.json are put into local node_modules folders of each package. In other words - I want to maintain old-style node_modules directory layout (let's pretend that I like duplicates :) ), where each top-level module holds its modules with itself.
And here is the problem. Top level directory () also contains node_modules with package1. And when I receive output from dependency-tree I have something like this:
.../dist/src/index.js
.../dist/node_modules/package2/index.js
.../node_modules/package1/index.js
NOT:
.../dist/src/index.js
.../dist/node_modules/package2/index.js
.../dist/node_modules/package2/node_modules/package1/index.js
If I'm not mistaken this algorithm assumes the second variant (it starts to look at the nearest node_modules folder and traverses to the root of the file system).
Am I wrong or something works not as expected? I have some checks after receiving list from dependency-tree. One of them is confirmation that common directory for all imports is dist folder. And this check started to fall when I tried to use npm i command inside dist folder with --global-style argument. Without it (when package1 folder resides at the same level as package2) all works as expected.
Can you confirm that I'm wrong :) or help to resolve the issue?
Thanks in advance! CC: @mrjoelkemp
- 主要言語
- JavaScript
- スター
- 776
- フォーク
- 82
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dependents/node-dependency-tree のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
question
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
-
question
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
dependents/node-dependency-tree#152 · コメント 2 件 ·
-
Why is precinctOptions.includeCore always false?再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
dependents/node-dependency-tree の issue をすべて見る
似ている issue
-
🐛 bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
LibreChat-AI/LibreChat#17887 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
liveshowy/webauthn_components#118 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
showdownjs/showdown#1113 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
dependents/node-precinct#167 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
volumio/volumio-plugins-sources-bookworm#279 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信