diffplug / diffplug/spotless

Prettier plugin can't find node executable

オープン
#2,707 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
5.7k
フォーク
561
平均マージ
1日 14時間
マージ済み PR(30日)
43

説明

I have prettier configured within a Maven `spotless-maven-plugin` block:

```

com.diffplug.spotless
spotless-maven-plugin
2.44.3



**/*.ts








```

When I run `mvn spotless:verify`, I get an error:

```
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.3:apply (default-cli) on project my-project: Unable to format file /some-file.ts: Can't automatically determine node executable and none was specifically supplied!
[ERROR]
[ERROR] Spotless was unable to find a node executable.
[ERROR] Either specify the node executable explicitly or make sure it can be found next to the npm executable.
```

I do have node and npm installed:

```
% which node
/opt/homebrew/opt/node@16/bin/node
% node --version
v16.20.2
% which npm
/opt/homebrew/opt/node@16/bin/npm
% npm --version
8.19.4
```

I can get around this by specifying the location of the node executable:

```

/opt/homebrew/opt/node@16/bin/node

```

.. but that's not something I should have to do and it isn't something that will work for everyone on our team who possibly have different versions, have installed in a different path, use a different OS, etc.

If the `node` executable is on the system path, that's what should be used.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、示されている Maven spotless:verify 設定で失敗を再現し、Prettier 統合が node 実行可能ファイルをどのように解決しているかを調査します。nodeExecutable をハードコードすることなく、システム PATH で利用可能な node 実行可能ファイルが検出され、既存の明示的な設定も引き続き機能すれば、問題は完了です。

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

評価

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

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

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