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

Running JS on Windows #185

Closed
richardschneider opened this issue Jan 27, 2018 · 4 comments
Closed

Running JS on Windows #185

richardschneider opened this issue Jan 27, 2018 · 4 comments

Comments

@richardschneider
Copy link
Contributor

richardschneider commented Jan 27, 2018

A few of our tests (see block.js) run JS code like this

const df = DaemonFactory.create({ exec: 'src/cli/bin.js' })

On Windows it fails with

>aegir test -f test\http-api\interface\block.js
Test Node.js


  .block
    1) "before all" hook


  0 passing (766ms)
  1 failing

  1) .block
       "before all" hook:
     Uncaught expected [Error: internal/child_process.js:340
    throw errnoException(err, 'spawn');
    ^

Error: spawn UNKNOWN
    at _errnoException (util.js:1031:13)
    at ChildProcess.spawn (internal/child_process.js:340:11)
    at exports.spawn (child_process.js:499:9)
    at module.exports (C:\Users\Owner\Documents\GitHub\js-ipfs\node_modules\comandante\index.js:11:14)
    at Object.<anonymous> (C:\Users\Owner\Documents\GitHub\js-ipfs\node_modules\subcomandante\subcom:23:13)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
] to not exist
  AssertionError: expected [Error: internal/child_process.js:340
      throw errnoException(err, 'spawn');
      ^

  Error: spawn UNKNOWN
      at _errnoException (util.js:1031:13)
      at ChildProcess.spawn (internal/child_process.js:340:11)
      at exports.spawn (child_process.js:499:9)
      at module.exports (C:\Users\Owner\Documents\GitHub\js-ipfs\node_modules\comandante\index.js:11:14)
      at Object.<anonymous> (C:\Users\Owner\Documents\GitHub\js-ipfs\node_modules\subcomandante\subcom:23:13)
  ] to not exist
      at factory.spawnNode (node_modules\interface-ipfs-core\src\block.js:32:30)
      at df.spawn (test\http-api\interface\block.js:17:20)
      at waterfall (node_modules\ipfsd-ctl\src\daemon-ctrl.js:132:16)
      at node_modules\async\internal\once.js:12:16
      at next (node_modules\async\waterfall.js:21:29)
      at node_modules\async\internal\onlyOnce.js:12:16
      at run (node_modules\ipfsd-ctl\src\daemon-node.js:128:16)
      at f (node_modules\once\once.js:25:25)
      at Object.done (node_modules\ipfsd-ctl\src\exec.js:23:18)
      at Stream.listeners.done.once (node_modules\ipfsd-ctl\src\exec.js:45:18)
      at Stream.f (node_modules\once\once.js:25:25)
      at Socket.reemit (node_modules\duplexer\index.js:70:25)
      at Pipe._handle.close [as _onclose] (net.js:558:12)
@richardschneider
Copy link
Contributor Author

I think that on windows, the issue is that .js files are not associated with node .

This was referenced Jan 27, 2018
@daviddias
Copy link
Member

I'm seeing this happening on Jenkins too. @dryajov are you on top of it?

@dryajov
Copy link
Member

dryajov commented Jan 27, 2018

That is handled in the code - on windows I prepend the node executable to the exe path. There might be a bug, I'll take a look. Also #187 should add a more robust handling of js executables, because it checks for .js in the path, rather than type !== 'go'.

@richardschneider
Copy link
Contributor Author

Fixed by #187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants