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

Quality Assurance Introduction to Selenium Test Drive Selenium Installation

Persistent NPM Selenium Webdriver installation error: "npm WARN saveError ENOENT: no such file or directory"

Hello all,

I've been trying to follow this installation video for several days, and have been unable to successfully troubleshoot nor find a lot of guidance for resolving the problem I'm encountering when installing Selenium Webdriver - the error message(s) are as follows: In the Terminal:

henrybrenton@Henrys-MacBook-Pro ~/SeleniumBasicsHB $ sudo npm install selenium-webdriver Password: npm WARN saveError ENOENT: no such file or directory, open '/Users/henrybrenton/SeleniumBasicsHB/package.json' npm WARN enoent ENOENT: no such file or directory, open '/Users/henrybrenton/SeleniumBasicsHB/package.json' npm WARN SeleniumBasicsHB No description npm WARN SeleniumBasicsHB No repository field. npm WARN SeleniumBasicsHB No README data npm WARN SeleniumBasicsHB No license field.

henrybrenton@Henrys-MacBook-Pro ~/SeleniumBasicsHB $

I'm really not sure as to how I can resolve this issue, and I'd like to progress with the course - some help and advice in finding a solution would be greatly appreciated - apologies if this is a basic error - I'm new to Node and Selenium, and have a lot to learn,

Many Thanks!


1 Answer

Took a look at the video and the instructor mentions getting the same error because he doesn't have a package.json folder in the directory the install was run from. But this error is a bit misleading, because the node_modules folder is still created and the dependencies installed (you can see with a ls node_modules from the directory you ran the install).

If you don't want the error, you can do an npm init -y in the directory you are using to generate a package.json file with sane defaults.

Edit: I also noticed you used sudo to install the package and I just wanted to let you know that is not recommended to use sudo when installing packages with tools like npm for reasons.