juliangruber / browser-run

Run code inside a browser from the command line
447 stars 62 forks source link

Fail while running with default electron browser #65

Closed vpryim-old closed 8 years ago

vpryim-old commented 8 years ago

I'm using next command:

echo "console.log('Hey from ' + location); window.close()" | browser-run

The Electron starts but with an error:

A JavaScript error occurred in the main process. Uncaught Exception: SyntaxError: Unexpected token import at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:404:25) at Object.Module._extensions..js (module.js:432:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:313:12) at Module.require (module.js:366:17) at require (module.js:385:17) at Object. (/Users/activeobject/.nvm/versions/node/v5.1.1/lib/node_modules/browser-run/node_modules/electron-stream/lib/runner.js:1:90) at Module._compile (module.js:425:26) at Object.Module._extensions..js (module.js:432:10)

It seems that electron-stream module has been published with raw sources. I'm using electron-stream@2.3.0.

juliangruber commented 8 years ago

i can't produce with latest browser-run. Can you try this:

$ git clone https://github.com/juliangruber/browser-run.git
$ cd browser-run
$ npm install
$ echo "console.log('Hey from ' + location); window.close()" | ./bin/bin.js
vpryim-old commented 8 years ago

It works now, don't know what was the problem. Thanks!