Cannot find module 'nightwatch/bin/runner.js'

3,018 views
Skip to first unread message

Rob Wilkerson

unread,
Jun 10, 2014, 8:09:19 AM6/10/14
to nightw...@googlegroups.com
I've had Nightwatch running locally (OS X) for a few days and wanted to get it installed on an upstream CI server (Ubuntu 12.04). All seems to go well and the module is installed globally, but when I try to run my tests I get the following:

Error: Cannot find module 'nightwatch/bin/runner.js'

The runner exists at /usr/lib/node_modules/nightwatch/bin/runner.js. My test runner (nightwatch.js) contains the following, as recommended for Linux and OS X:

#!/usr/bin/env node
require('nightwatch/bin/runner.js');

Any idea what I might be missing here? It may be worth noting that this is a headless Ubuntu CI server on AWS. I don't know whether that will suffice for the Selenium driver(s), but I'm prepared to migrate to BrowserStack if it's not. It doesn't seem like this would impact Nightwatch's ability to find the runner, but this is my first spin with using it for integration tests so I'm all too prepared to be wrong.

Any insight would be much appreciated.

Andrei Rusu

unread,
Jun 10, 2014, 8:20:53 AM6/10/14
to Rob Wilkerson, nightw...@googlegroups.com
if you installed nightwatch globally (npm install -g) you don't need to create a runner yourself. nightwatch should be available in your path globally so you can get rid of the nightwatch.js runner.


--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.
To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/51b4635f-b6f5-4a21-9b1f-7ce91be10096%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rob Wilkerson

unread,
Jun 10, 2014, 8:28:48 AM6/10/14
to nightw...@googlegroups.com, r...@robwilkerson.org
Problem solved. I read that line in the the documentation and didn't realize it applied to the entire "Test Runner" section. Thanks a lot for the quick reply. Much appreciated.
Message has been deleted

lamyarus

unread,
Mar 12, 2015, 7:34:38 AM3/12/15
to nightw...@googlegroups.com
 I just made the same mistake the second time. I tried it two months ago and solved the problem then I forgot about it. When I tried it today, I did the same mistake. I suggest editing that part in the documentation.

Triguna Mutuguppe Sripathi

unread,
Jul 18, 2018, 3:10:25 AM7/18/18
to NightwatchJs
I had the exact same issue and for me it was permission to write to the folder node_modules. After changing the permission it worked smoothly.
Reply all
Reply to author
Forward
0 new messages