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
node examples/hello.js does not work #14
Comments
In my case I get the following error message when trying to run the hello.js
Tested with CasperJS 1.0.0-RC4 and Phantomjs 1.7.0 |
@sanoodles: I need more information to help you. If you installed by cloning the repo, you should run |
@Mooonk: Please uncomment the marked lines in |
@lawnsea The error occured when I installed Spooky via NPM, but somehow this package differs from the one here at github (at least they contain a different hello.js). After cloning the repository and running |
Ok, I can repro this. It just hangs. I'll see what's up. |
Ok, the problem is that the spooky_lib: './' |
This is still a bug. The README should give working instructions for running the example from an npm install and from the repo. |
@lawnsea I just cloned the repo again and set spooky_lib: './' in hello.js but the behavior is the same: it just hangs with no output at all. |
@sanoodles I can't confirm this. Which versions of phantomjs and casperjs are you using? Which steps did you make after cloning? Just run |
I do:
Also I've tried uncommenting the onconsole event, and also running sudo npm install instead of simply npm install. Running just "casperjs" I get: |
same thing, no output
oh boy
|
@sanoodles I can't reproduce the issue using the described steps. I don't know what to tell you at this point, other than to wait and see if whatever my fix for #4 is will make it clear where things are breaking. If you want to investigate yourself, you can try adding |
looking at the source code, I have at least made progress here. It is extremely unclear in the instructions that spooky_lib is actually supposed to point to the node_modules directory inside of spooky, and if you've done a git checkout, you need to do npm install in your spooky dir first. It is also extremely unclear that spooky_lib will be relative to where you are running your script, not relative to the folder that js file is in. Suggest a readme update. Will submit a PR if I have an off hour. This is why I think the user shouldn't have to worry about the spooky install directory nor passing paths to the spooky startup script. I think it's work that could just be magic'd away with __dirname |
I'm now getting "Failed to initialize SpookyJS Error: connect ECONNREFUSED" however if I do
it sits their happily with the ready thingy emitted but if I run this inside of a node cli:
it exits: we got exit 1 null It's happening in the create call:
get the same connection refused error if I change 'create' to something else... tests are passing though... |
Does |
I did everything as pointed out above and non working. My error:
At this point, if there is no fix or a way to troubleshoot, my project using this has to change direction to something else... :-( |
For me, the error message above was because I didn't put CasperJS executable in the global path. You need to do |
I use Windows 7. Is "global path" different from PATH in Windows? Because I type "casperjs" in command prompt and it does work. |
@lawnsea Sorry for my delay answering. I've put console.logs at the end of the constructor and _spawnChild and both are printed in the console. After that, the console has no more characters, and neither the process ends; as if it was waiting for something. What should I test now? Thank you! |
@sanoodles i had an issue with casperjs execution (spooky was just hanging) so i added a log statement just above this line to print the command, something like this:
then i just ran the command by itself and found that casper was throwing an error that somehow wasn't getting printed in spooky, and i was able to fix the issue. i'd recommend trying that. |
@aaronj1335 Do you think you can you reproduce the hang you describe? If so, please file a bug with the repro, so we can figure out what needs to be done to catch and report the error. Hanging is suboptimal. |
@lawnsea I printed the command as @aaronj1335 said and then ran it. The command in my case is:
and the output is
and then it hangs. So I'm not seeing the error @aaronj1335 said, but it hangs. |
@sanoodles looks like casper is doing what it's supposed to -- it's sending an RPC message over stdio to spooky saying it's ready. maybe throw a log statement here to check whether spooky is getting the message and how it's being handled. |
@aaronj1335 I put a console.log between here and here but it is never executed. |
@sanoodles hm, seems like it's happening somewhere in the RPC server then. you may try changing the transport between http and stdio, but otherwise you'll have to dig deeper to find the where the disconnect is. |
@aaronj1335 It worked ! ! ! $ node examples/hello.js |
@sanoodles are you on windows? i've had problems with windows buffering stdio until termination before, in which case it would make sense that you needed to use http. |
@aaronj1335 No. It's an Ubuntu 12.04, later Lubuntu, later Xubuntu. My uname -a is: |
@aaronj1335 It's actually @sanoodles Try putting a console.log here to see if the output is arriving. |
@aaronj1335 nm. misread 'stdio' as 'stdin'. |
@lawnsea I put this
and after "constructor end", instead of nothing now there is: new FilteredStream function data: CasperError: __mod_error(./lib/bootstrap/stdio-server):: Unable to open file '/dev/stdin' I've also tried running with sudo but it's been the same. |
OK I may sound really stupid posting this (node.js newbie myself) but I still got
I executed using this
and this is the directory tree I have in Windows.
Here is defaults
There is PATH in Windows for casperjs (I typed it in command prompt and it worked). What code I need to change in spooky.js path? |
Any help please? |
@quanghoc I'm sorry, I don't know how to help you at this point. Error code 127 usually means that there's a problem with your PATH. I don't know enough about node on Windows to help you. I'm guessing that |
Hi. In Windows is problem with casperjs file name. Executable name is casperjs.bat (PATH capserjs/batchbin/casperjs.bat) . For me it works only if |
Hello all, (ubuntu 12.10) |
Closing, since @sanoodles can run with http transport. If someone has interest in determining why stdio transport doesn't work in Windows and Ubuntu, please open a new issue. |
Same problem when running SpookyJS from CentOS 6.3, I solved it using the method given by @quanghoc but with var defaults = {
transport: {
http: {
host: 'localhost',
}
},
child: {
command: 'casperjs',
port: 8081,
script: './node_modules/spooky/lib/bootstrap.js',
spooky_lib: './node_modules/spooky/',
transport: 'http',
bufferSize: 16 * 1024 // 16KB
},
casper: {
verbose: true,
logLevel: 'debug'
}
}; Thank you @quanghoc !! |
Hello, I just downloaded the SpookyJS folder, and ran
node examples/hello.js
in it, but apparently it does nothing.
I've already installed several dependencies it requested such as
underscore async carrier duplexer tiny-jsonrpc http-server
and now it does not complaint, but neither prints anything.
What can I be doing wrong?
Thank you.
The text was updated successfully, but these errors were encountered: