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

ENOENT error #2

Closed
coljung opened this issue Dec 4, 2014 · 14 comments
Closed

ENOENT error #2

coljung opened this issue Dec 4, 2014 · 14 comments

Comments

@coljung
Copy link

coljung commented Dec 4, 2014

When i try to run this i get an error, i followed the steps and im not sure what im missing.

To get the error I went to the specified folder and ran gulp echo, this is the message received:

[11:51:14] Using gulpfile ~\Projects\git\myCoolProject\bower_components\backstopjs\gulpfile.js
[11:51:14] Starting 'echo'...
[11:51:14] Finished 'echo' after 2.22 ms

events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1001:11)
at Process.ChildProcess._handle.onexit (child_process.js:792:34)

Thanks!

@garris
Copy link
Owner

garris commented Dec 4, 2014

It looks like there is a missing file. what is the path of your backstop.json file? What platform are you on? and can you post your config file contents?

@garris garris added the question label Dec 5, 2014
@Jenkosama
Copy link

I have the same problem on windows 8.

@coljung
Copy link
Author

coljung commented Dec 5, 2014

Path for the backstop.js file:
/myproject/backstop.json

Im on Win8

Also, by config file you mean my gulpfile.js?

@garris
Copy link
Owner

garris commented Dec 5, 2014

Hi, Thanks, I meant this file --> myproject/backstop.json

This one will be hard for me to troubleshoot since I don't have a proper win8 machine. There must be an issue with installation. Admittedly, the process is not as straightforward as I would like.

@coljung
Copy link
Author

coljung commented Dec 5, 2014

Sure, here is the code:

{
"viewports" : [
{
"name": "phone",
"viewport": {"width": 320, "height": 480}
}
,{
"name": "tablet_v",
"viewport": {"width": 568, "height": 1024}
}
,{
"name": "tablet_h",
"viewport": {"width": 1024, "height": 768}
}
]
,"grabConfigs" : [
{
"testName":"name"
,"url":"../../index.html"
,"hideSelectors": [
]
,"removeSelectors": [
]
,"selectors":[
"nav"
,".jumbotron"
,"body .col-md-4:nth-of-type(1)"
,"body .col-md-4:nth-of-type(2)"
,"body .col-md-4:nth-of-type(3)"
,"footer"
]
}
]
}

@garris
Copy link
Owner

garris commented Dec 5, 2014

oh, that is interesting... Couple of things.

Can you cd to here myCoolProject/bower_components/backstopjs and run gulp genConfig

Then run gulp echo -- you should get http://getBootstrap.com/ homepage in the console...

Please let me know how it goes... thanks!

@coljung
Copy link
Author

coljung commented Dec 5, 2014

Nope..
C:\Users\Pablo\Projects\git\myCoolProject\bower_components\backstopjs
λ gulp genConfig
[16:10:46] Using gulpfile ~\Projects\git\myCoolProject\bower_components\backstopjs\gulpfile.js
[16:10:46] Starting 'genConfig'...
[16:10:46] Finished 'genConfig' after 25 ms

but then i tried gulp echo:

C:\Users\Pablo\Projects\git\myCoolProject\bower_components\backstopjs
λ gulp echo
[16:12:26] Using gulpfile ~\Projects\git\myCoolProject\bower_components\backstopjs\gulpfile.js
[16:12:26] Starting 'echo'...
[16:12:26] Finished 'echo' after 3.15 ms

events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1001:11)
at Process.ChildProcess._handle.onexit (child_process.js:792:34)

@garris
Copy link
Owner

garris commented Dec 5, 2014

Alrighty then, That looks broken. :(

Could you try running this... sudo npm install -g phantomjs

You can run that from any location -- it should install phantomjs globally. Someone recently commented they needed to do this -- but I haven't had a chance to verify it. Please do this and then cd back to myCoolProject/bower_components/backstopjs and run gulp echo again...

also, just to confirm, your config file now looks like this... yes?

{
    "viewports" : [
        {
         "name": "phone",
         "viewport": {"width": 320, "height": 480}
        }
        ,{
         "name": "tablet_v",
         "viewport": {"width": 568, "height": 1024}
        }
        ,{
         "name": "tablet_h",
         "viewport": {"width": 1024, "height": 768}
        }
    ]
    ,"grabConfigs" : [
        {
            "testName":"http://getbootstrap.com"
            ,"url":"http://getbootstrap.com"
            ,"hideSelectors": [
            ]
            ,"removeSelectors": [
                "#carbonads-container"
            ]
            ,"selectors":[
                "header"
                ,"main"
                ,"body .bs-docs-featurette:nth-of-type(1)"
                ,"body .bs-docs-featurette:nth-of-type(2)"
                ,"footer"
                ,"body"
            ]
        }
    ]
}

@lewisnyman
Copy link
Contributor

I also had this issue, I found that I had to run:
npm install phantomjs npm install -g casperjs

Shouldn't these be included in the package.json?

@garris
Copy link
Owner

garris commented Dec 17, 2014

@coljung @Jenkosama Just checking in, were you able to resolve the issue?

@brutaldev
Copy link
Contributor

Had the same problem when required libraries where missing for the dependency projects (namely PhantomJS and CasperJS).

In your console, execute the command phantomjs to see if it starts properly. Then also try casperjs to ensure that starts properly as well. (Ctrl+C to exit)

When executing casperjs I got an error stating that 'python' is not recognized as an internal or external command so I had to install Python, add it to the PATH, and restart the console.

This fixes the normal executing but still fails to perform the echo in Windows because the CasperJS process name is not correct,

brutaldev added a commit to brutaldev/BackstopJS that referenced this issue Dec 18, 2014
The `echo` command does not work in Windows because `casperjs` needs to be launched with the .cmd extension. This is done correctly in the `test` task but not in `echo`.
garris added a commit that referenced this issue Dec 18, 2014
Fix echo in Windows (issue #2)
@garris
Copy link
Owner

garris commented Dec 18, 2014

Many thanks to @brutaldev for the bug fix!

Also, I think these comments will help a lot of win users who have not already loaded phantomjs, casperjs & python.

#14 has been merged in and will be released in v0.2.5.

@garris garris closed this as completed Dec 18, 2014
garris added a commit that referenced this issue Dec 18, 2014
fixed ENOENT error #2
@matt-newman
Copy link

I know this is a closed issue, but I had this problem and the above steps didn't quite work for me, I had everything installed and running independently, but as I'd installed casperjs a long time ago independently it existed elsewhere on my PATH:

You can work out if you're having the same problem by using:
On windows cmd:

where phantomjs
where casperjs

On windows 'bash' (mysys, gitbash, etc):

which phantomjs
which casperjs

It's easiest if they're all in the same location, for me I made that npm global installs, e.g: /c/Users/{USERNAME}/AppData/Roaming/npm/

casperjs was in a different location so I had to remove that reference (environment variables) and install it via:
npm install -g casperjs

hope that helps someone

@garris
Copy link
Owner

garris commented Mar 23, 2015

@matt-newman, thanks for posting this.

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

No branches or pull requests

6 participants