I'm using the experimental javascript backend and ...
# general
s
I'm using the experimental javascript backend and running into the following when trying to run the
storybook
devserver
Copy code
Error: spawn open ENOENT
    at __node_internal_captureLargerStackTrace (node:internal/errors:464:5)
    at __node_internal_errnoException (node:internal/errors:594:12)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn open',
  path: 'open',
  spawnargs: [ '<http://localhost:6006/>' ]
I can validate that
npm --prefix /private/var/folders/m8/cmsvrd417n39w5xjzjhmnznm0000gq/T/pants-sandbox-KRSl6M run run-storybook
works but (what I think are the relevant bits from
__run.sh
in the sandbox)
Copy code
env -i PATH=$'/private/var/folders/m8/cmsvrd417n39w5xjzjhmnznm0000gq/T/pants-sandbox-KRSl6M/_binary_shims_cdd60ac6ea9db484515d1bc36e0a9b992c89650ef4e5b32a200da6e9ae172946:/private/var/folders/m8/cmsvrd417n39w5xjzjhmnznm0000gq/T/pants-sandbox-KRSl6M/__node/._corepack:/private/var/folders/m8/cmsvrd417n39w5xjzjhmnznm0000gq/T/pants-sandbox-KRSl6M/__node/./node-v16.15.0-darwin-arm64/bin' npm --prefix /private/var/folders/m8/cmsvrd417n39w5xjzjhmnznm0000gq/T/pants-sandbox-KRSl6M run run-storybook
does not. It seems like
/usr/bin/open
isn't being included in
/private/var/folders/m8/cmsvrd417n39w5xjzjhmnznm0000gq/T/pants-sandbox-KRSl6M/_binary_shims_cdd60ac6ea9db484515d1bc36e0a9b992c89650ef4e5b32a200da6e9ae172946
Is there a way I can manually add
/usr/bin/open
as a dependency to my
package_json
?
l
have little context for the javascript side but in other contexts https://www.pantsbuild.org/docs/reference-system_binary can be used to express the dep on such a target, but I think you want something similar to the
tools
arg in shell commands https://www.pantsbuild.org/docs/run-shell-commands . Can you share the piece of BUILD file related to the issue you are having and which pants command you are running?
s
Sure, my BUILD file looks like
Copy code
resource(
    name="babelrc",
    source=".babelrc.json",
)

package_json(
    name="package_json",
    source="package.json",
    scripts=[
        node_build_script(
            entry_point="run-storybook",
        ),
    ],
    dependencies=[
        ":babelrc",
        "src/storybook",
        "src/public",
        "src/stories",
    ]
)
The command I'm running is
pants run :package_json#run-storybook