hey! sorry to just keep bombing in here with quest...
# general
a
hey! sorry to just keep bombing in here with questions but - I am following the example for the javascript adhoc_tool example pretty closely - however I have an issue finding(?) npm on my path
Copy code
src/delivery/dashboard on  nate/pants-2.22 [$!?⇡] via  v22.9.0 via :snake: v3.8.13 (remit) on :cloud:  <mailto:nate@sendwave.com|nate@sendwave.com> took 8s
❯ pants run :run-dashboard
20:55:46.70 [INFO] Completed: Testing candidate for `npm` at `/opt/homebrew/bin/npm`
20:55:46.71 [ERROR] 1 Exception encountered:

Engine traceback:
  in `run` goal - environment:local_osx

ValueError: Could not find a binary with name `npm`. The following paths were searched: /usr/bin, /bin, /usr/local/bin, /opt/homebrew/bin.
20:55:46.71 [INFO] Wrote log to .pants.d/pants_run_2024_10_09_20_55_45_739_b2e3398f9d544b7ea4cc351695e72fd3.json
However I do have npm on my path (and can run it just fine normally). I removed the fingerprint arguments from the system binary target (i'll attach that in this thread as well)
Copy code
src/delivery/dashboard on  nate/pants-2.22 [$!?⇡] via  v22.9.0 via :snake: v3.8.13 (remit) on :cloud:  <mailto:nate@sendwave.com|nate@sendwave.com>
❯ which npm
/opt/homebrew/bin/npm
Copy code
python_sources()

files(
    name="package-config",
    sources=[
        "package.json",
        "package.lock",
    ],
    dependencies=[],
)

files(name="js-files",
      sources=[
        "jsconfig.json",
        "nuxt.config.js",
        "**/*.ico",
        "**/*.js",
        "**/*.scss",
        "**/*.svg",
        "**/*.vue",
    ])

system_binary(name="node",
              binary_name="node",
)

system_binary(name="npm",
              binary_name="npm",
              fingerprint_dependencies=[":node"],
)


adhoc_tool(
    name="node-modules",
    runnable=":npm",
    runnable_dependencies=[":node"],
    args=["install", "--immutable"],
    output_dependencies=[":package-config"],
    execution_dependencies=[":package-config"],
    output_directories=["node_modules"],
)


adhoc_tool(name="node-package",
           runnable=":npm",
           runnable_dependencies=[":node"],
           args=["run", "pants:build"],
           execution_dependencies=[":node-modules", ":js-files"],
           output_files=["dist/**"])





run_shell_command(
    name="run-dashboard",
    command="npm run dev",
    execution_dependencies=[
        ":node-modules",
        ":node-package",
    ]
)
c
Sorry this is a shot in the dark, but I am suspicious of the fingerprint_ settings. Does the behavior change if
fingerprint_dependencies
is omitted, or fingerprint_ settigns are added to
node
?
oh,, and this thread might also have useful context: https://pantsbuild.slack.com/archives/C046T6T9U/p1729031504435309
a
@curved-manchester-66006 I'll try and pick this back up soon! but thanks for checking in. I did mess around with adding different values & removing for fingerprint_settings/arguments, etc
I do think the issue might be that the
npm
'binary' is a link - I'll check out the new version of pants