Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command failed with ENOENT: ipfs/src/cli/bin.js daemon... when spawing a js node from a factory #471

Closed
sebastiendan opened this issue Mar 6, 2020 · 2 comments
Assignees
Labels
exp/novice Someone with a little familiarity can pick up topic/docs Documentation

Comments

@sebastiendan
Copy link

sebastiendan commented Mar 6, 2020

Hi,

#458 introduced changes on how the js/go bin are resolved, but Usage on README was not updated, so took me a while before understanding I have to specify the bin path, the same way it's done in /examples.

When testing with:

this.node = await factory.spawn({
  type: 'js',
  ipfsBin: require.resolve('ipfs/src/cli/bin.js'),
})

I get the following error:

Command failed with ENOENT: ipfs/src/cli/bin.js daemon --enable-preload false
spawn ipfs/src/cli/bin.js ENOENT 


    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:81:21)
@sebastiendan
Copy link
Author

Besides the documentation issue, It seems the problem is coming from my environment: passing the path manually works.

this.node = await factory.spawn({
      type: 'js',
      ipfsBin: join(
        __dirname,
        '..',
        '..',
        '..',
        'node_modules/ipfs/src/cli/bin.js'
      ),
    })

My context is a NestJS (so NodeJS) app inside an Nx workspace.
That's my first project with Nx so I'll investigate for this part.

For now require.resolve just returns whatever string that is passed to it...

@hugomrdias hugomrdias self-assigned this Mar 15, 2020
@hugomrdias hugomrdias added kind/bug A bug in existing code (including security flaws) exp/novice Someone with a little familiarity can pick up topic/docs Documentation and removed kind/bug A bug in existing code (including security flaws) labels Mar 15, 2020
@hugomrdias
Copy link
Member

readme docs and types were improved to explain this better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up topic/docs Documentation
Projects
None yet
Development

No branches or pull requests

2 participants