famous-xylophone-36532
10/25/2023, 11:59 AM13:58:46.73 [ERROR] 1 Exception encountered:
Engine traceback:
in `run` goal
ValueError: Could not find a binary with name `npm`. The following paths were searched: /usr/bin, /bin, /usr/local/bin, /opt/homebrew/bin.
peder(feature/widgets)$ which npm
/opt/homebrew/bin/npm
famous-xylophone-36532
10/25/2023, 12:01 PMpants run 3rdparty/sys:node -- --version
it works. Hm!famous-xylophone-36532
10/25/2023, 12:11 PM# Frontend folder BUILD
files(
name = "package",
sources = [
"package.json",
"package-lock.json",
]
)
files(
name = "src",
sources = [
"./src/*.js",
"./src/*.html",
"./src/*.css",
]
)
adhoc_tool(
name = "dependencies",
runnable="//3rdparty/sys:npm",
runnable_dependencies=[
"//3rdparty/sys:npm",
],
args=["i"],
execution_dependencies = [
":package",
],
output_directories = ["node_modules"],
)
adhoc_tool(
name = "build",
runnable = "//3rdparty/sys:npm",
runnable_dependencies=[
"//3rdparty/sys:npm",
],
args = ["run","package"],
execution_dependencies = [
":dependencies",
":src",
],
output_directories = ["dist"],
)
run_shell_command(
name = "mock",
command = "ls",
runnable_dependencies=["//3rdparty/sys:npm"],
execution_dependencies = [":build"],)
---
#3rdparty/sys/BUILD
system_binary(
name = "node",
description = "The Javascript Runtime.",
binary_name = "node",
#fingerprint = r"v20.8.[0-9]+",
#fingerprint_args = ["--version"],
)
system_binary(
name = "npm",
description = "The Node Package Manager.",
binary_name = "npm",
#fingerprint = r"v10.1.[0-9]+",
#fingerprint_args = ["--version"],
#fingerprint_dependencies = [":node"],
)
I commented out the fingerprinting part since I thought it was causing the issue/.bored-soccer-37961
10/26/2023, 1:45 AMnpm
returns a non-zero exit code
I ended up working around it by using shell_command
instead
https://github.com/pantsbuild/pants/issues/19013