Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Amber Harlow](https://secure.gravatar.com/avatar/aa17d00dd8823c3458b81de1fbca9270?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Amber Harlow
Java Web Development Techdegree Student 11,542 PointsTypeError: suite is not a function
I am getting the following error when trying to run my test. I even copied and pasted the snippet provided in the Teacher's Notes. Any ideas?
TypeError: suite is not a function
at Object.<anonymous> (/Users/Amber/PROJECT/test/invitees.js:12:1)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at /usr/local/lib/node_modules/mocha/lib/mocha.js:250:27
at Array.forEach (<anonymous>)
at Mocha.loadFiles (/usr/local/lib/node_modules/mocha/lib/mocha.js:247:14)
at Mocha.run (/usr/local/lib/node_modules/mocha/lib/mocha.js:576:10)
at Object.<anonymous> (/usr/local/lib/node_modules/mocha/bin/_mocha:637:18)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
![Steven Sullivan](https://uploads.teamtreehouse.com/production/profile-photos/7696112/micro_me.jpg)
Steven Sullivan
11,616 PointsJay McGavren, I am facing a similar problem as well. My output from the Node REPL with require ("selenium-webdriver/testing");
results in the following:
> require("selenium-webdriver/testing");
{ controlFlow: [Function],
describe: { [Function] only: [Function], skip: [Function] },
xdescribe: [Function],
after: [Function],
afterEach: [Function],
before: [Function],
beforeEach: [Function],
it: { [Function] only: [Function], skip: [Function] },
xit: [Function],
ignore: [Function: ignore] }
2 Answers
![Jay McGavren](https://uploads.teamtreehouse.com/production/profile-photos/121450/micro_jay_teaching.jpg)
Jay McGavren
Treehouse TeacherSteve Sullivan My apologies for not replying earlier; I didn't get a notification that this forum thread had been updated.
I suspect that you (and also Amber Harlow ) have an older version of selenium-webdriver
installed than that used in the videos, and that's why it's not working. To test this, you'll need to run two separate commands: npm list selenium-webdriver
(to see which version is installed in your project directory) and npm list -g selenium-webdriver
(to see which version, if any, is installed globally).
Here's the output I got.
$ npm list selenium-webdriver
/Users/jay/th/selenium/project
└── selenium-webdriver@4.0.0-alpha.1
$ npm list -g selenium-webdriver
/usr/local/lib
└── selenium-webdriver@3.6.0
It is okay if npm list -g selenium-webdriver
doesn't return anything. But npm list selenium-webdriver
needs to show selenium-webdriver@4.0.0-alpha.1
(or later). If it shows selenium-webdriver@3.6.0
, then you'll need to do an npm install selenium-webdriver
within your project directory to install the latest version, or the instructions in the videos for this course won't work correctly.
![Ali Kholafaei](https://secure.gravatar.com/avatar/f68b1f3444109d63078a85736d8d4091?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Ali Kholafaei
911 PointsThanks Jay, I had the same issue and it got fixed after updating my selenium-webdriver version from 3.6 to 4.
Jay McGavren
Treehouse TeacherJay McGavren
Treehouse TeacherThis is the snippet you saved to
test/invitees.js
, correct?When I type
node
by itself in a terminal to launch the Node REPL, then typerequire("selenium-webdriver/testing");
, I get this output:...What do you get?