[Bug]: Build fails with "Unknown cli flag: --scripts-prepend-node-path" due to outdated Spotless plugin

未关闭 适合新手
#11,997 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
java
领域
build-system

调研方向

找到声明 Spotless 插件的 Gradle 配置,并检查构建使用的版本。运行 ./gradlew build,重点关注 :test-support:spotlessJava;当构建完成且没有出现 npm --scripts-prepend-node-path 错误时即表示完成。

由索引模型根据 Issue 内容生成。

描述

type/bug
Module

Core

Testcontainers version

latest master

Using the latest Testcontainers version?

Yes

Host OS

macOS

Host Arch

arm

Docker version
Client:
 Version:           29.7.2
 API version:       1.55
 Go version:        go1.26.5
 Git commit:        a7dcaa6
 Built:             Wed Aug  5 18:27:50 2026
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.87.0 (236836)
 Engine:
  Version:          29.7.2
  API version:      1.55 (minimum version 1.40)
  Go version:       go1.26.5
  Git commit:       6a43e3d
  Built:            Wed Aug  5 18:28:35 2026
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          v2.2.5
  GitCommit:        e53c7c1516c3b2bff98eb76f1f4117477e6f4e66
 runc:
  Version:          1.3.6
  GitCommit:        v1.3.6-0-g491b69ba
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
What happened?

The Gradle build fails with an error related to the Spotless plugin when it tries to run prettier. The error is:

npm error Unknown cli flag: --scripts-prepend-node-path

This happens because the version of Spotless used by the project does not support this npm flag. The issue was fixed upstream in Spotless version 8.10.1 (see diffplug/spotless#3024).

Expected behavior

The build should complete successfully without npm-related errors.

Current behavior

The build fails during the :test-support:spotlessJava task.

Steps to reproduce
  1. Clone the repository.
  2. Run ./gradlew build.
Proposed solution

Update the Spotless plugin to version 8.10.1 or later.

Relevant log output
> Task :test-support:spotlessJava FAILED
...
npm error Unknown cli flag: --scripts-prepend-node-path
...
Additional Information

No response

主要语言
Java
星标
8.7k
派生
1.9k
平均合并
2 天 17 小时
30 天内合并 PR
9

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

testcontainers/testcontainers-java 的其他 Issue

查看 testcontainers/testcontainers-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。