Prettier plugin can't find node executable
- Lenguaje dominante
- Java
- Estrellas
- 5.6k
- Forks
- 559
- Merge medio
- 1 d 14 h
- PR fusionados (30 d)
- 43
Descripción
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.
Guía de contribución
Línea de trabajo
Comienza reproduciendo el fallo con la configuración mostrada de Maven spotless:verify e inspecciona cómo la integración de Prettier resuelve el ejecutable de node. El problema estará resuelto cuando se detecte un ejecutable de node disponible en el PATH del sistema sin requerir que nodeExecutable esté codificado explícitamente, mientras la configuración explícita existente siga funcionando.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- node.js, typescript
- Área
- build-system, tooling
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 52/100