convex-backend icon indicating copy to clipboard operation
convex-backend copied to clipboard

No such file or directory (os error 2)

Open xixixao opened this issue 4 months ago • 2 comments

When node is not on path, the backend now fails during deploy (before, like 6 months ago, I don't think Node was required during deploy).

  1. Is node needed for all deploys?
  2. Can we add better error handling?

For 2, it would probably suffice to change:

async fn check_node_version(node_path: &str) -> anyhow::Result<()> {
        let cmd = TokioCommand::new(node_path)
            .arg("--version")
            .output()
            .await?;

to

async fn check_node_version(node_path: &str) -> anyhow::Result<()> {
        let cmd = TokioCommand::new(node_path)
            .arg("--version")
            .output()
            .await
            .context("`node` is not on PATH")?;

Current error (quite cryptic):

Hit an error while pushing:                                                                                                             │
│ Failed to initialize inner local node executor                                                                                                                                            │
│                                                                                                                                                                                           │
│ Caused by:                                                                                                                                                                                │
│     0: Failed to initialize inner local node executor                                                                                                                                     │
│     1: No such file or directory (os error 2)                                                                                                                                             │
│                                                                                                                                                                                           │
│ Stack backtrace:                                                                                                                                                                          │
│    0: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from                                                                                                                │
│    1: <async_once_cell::InitFuture<T,F> as core::future::future::Future>::poll::{{closure}}                                                                                               │
│    2: <async_once_cell::InitFuture<T,F> as core::future::future::Future>::poll

xixixao avatar Aug 19 '25 15:08 xixixao

Nice Let's definitely do (2).

I believe node is required if there are any "use node" actions in the project.

nipunn1313 avatar Aug 19 '25 17:08 nipunn1313

@nipunn1313 but as far as I can tell, it's required on startup of the backend, even a completely empty one, that cannot know whether there are any node actions.

xixixao avatar Aug 21 '25 06:08 xixixao