Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Quality Assurance Introduction to Selenium Test Drive Selenium Installation

So far nothing works

tried doing what he says npm install selenium-webdriver@3

npm WARN saveError ENOENT: no such file or directory, open '/Users/z/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/z/package.json'
npm WARN @angular/animations@5.2.8 requires a peer of @angular/core@5.2.8 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.0.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.0.0 requires a peer of popper.js@^1.12.9 but none is installed. You must install peer dependencies yourself.
npm WARN prop-types-extra@1.0.1 requires a peer of react@>=0.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-bootstrap@0.32.1 requires a peer of react@^0.14.9 || >=15.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-bootstrap@0.32.1 requires a peer of react-dom@^0.14.9 || >=15.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-overlays@0.8.3 requires a peer of react@^0.14.9 || >=15.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-overlays@0.8.3 requires a peer of react-dom@^0.14.9 || >=15.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-prop-types@0.4.0 requires a peer of react@>=0.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-transition-group@2.3.0 requires a peer of react@>=15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-transition-group@2.3.0 requires a peer of react-dom@>=15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN uncontrollable@4.1.0 requires a peer of react@>=0.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN z No description
npm WARN z No repository field.
npm WARN z No README data
npm WARN z No license field.
$ls node_modules
ls: node_modules: No such file or directory
$ npm install chromedriver -g
/Users/z/.npm-global/bin/chromedriver -> /Users/z/.npm-global/lib/node_modules/chromedriver/bin/chromedriver

> chromedriver@2.38.3 install /Users/z/.npm-global/lib/node_modules/chromedriver
> node install.js

Downloading https://chromedriver.storage.googleapis.com/2.38/chromedriver_mac64.zip
Saving to /var/folders/1z/fbnffqjs3s76vkymj8jvc4hh0000gn/T/chromedriver/chromedriver_mac64.zip
Received 781K...
Received 1568K...
Received 2352K...
Received 3136K...
Received 3920K...
Received 4704K...
Received 5447K total.
Extracting zip contents
Copying to target path /Users/z/.npm-global/lib/node_modules/chromedriver/lib/chromedriver
Fixing file permissions
Done. ChromeDriver binary available at /Users/z/.npm-global/lib/node_modules/chromedriver/lib/chromedriver/chromedriver
+ chromedriver@2.38.3
added 96 packages from 68 contributors in 4.162s
zxl4s-MBP:selenium z$ sudo npm install chromedriver -g
Password:
/Users/z/.npm-global/bin/chromedriver -> /Users/z/.npm-global/lib/node_modules/chromedriver/bin/chromedriver

> chromedriver@2.38.3 install /Users/z/.npm-global/lib/node_modules/chromedriver
> node install.js

/Users/z/.npm-global/lib/node_modules/chromedriver/chromedriver is not writable: EACCES: permission denied, mkdir '/Users/z/.npm-global/lib/node_modules/chromedriver/chromedriver'
Downloading https://chromedriver.storage.googleapis.com/2.38/chromedriver_mac64.zip
Saving to /tmp/chromedriver/chromedriver_mac64.zip
Received 781K...
Received 1568K...
Received 2352K...
Received 3136K...
Received 3920K...
Received 4704K...
Received 5447K total.
Extracting zip contents
Copying to target path /Users/z/.npm-global/lib/node_modules/chromedriver/lib/chromedriver
ChromeDriver installation failed { Error: EACCES: permission denied, mkdir '/Users/z/.npm-global/lib/node_modules/chromedriver/lib/chromedriver'
    at Object.fs.mkdirSync (fs.js:885:18)
    at /Users/z/.npm-global/lib/node_modules/chromedriver/install.js:230:10
    at <anonymous>
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/Users/z/.npm-global/lib/node_modules/chromedriver/lib/chromedriver' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! chromedriver@2.38.3 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the chromedriver@2.38.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/z/.npm/_logs/2018-05-09T15_06_57_378Z-debug.log

1 Answer

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,703 Points

As for the first error, this is the error we were expecting (see 2:09 in the video). It's because we hadn't initialized an npm project but it should have still installed the node_modules. Did you make a directory called selenium_basics or something to work on the project in? Are you running ls in the same directory?

As for the last error, try using sudo:

sudo npm install chromedriver -g

This is what he does at 2:53 in the video.