Prettier plugin can't find node executable
- Lingua principale
- Java
- Stelle
- 5.6k
- Fork
- 559
- Merge medio
- 1g 14h
- PR unite (30g)
- 43
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia riproducendo il malfunzionamento con la configurazione Maven spotless:verify mostrata e analizza come l’integrazione di Prettier risolve l’eseguibile node. Il problema è risolto quando viene rilevato un eseguibile node disponibile nel PATH di sistema senza richiedere che nodeExecutable sia codificato direttamente, mentre la configurazione esplicita esistente continua a funzionare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- node.js, typescript
- Ambito
- build-system, tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100