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.
Persistent NPM Selenium Webdriver installation error: "npm WARN saveError ENOENT: no such file or directory"
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.
- firstname.lastname@example.org updated 1 package and audited 126 packages in 1.485s found 0 vulnerabilities
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,
Erik Krieg43,038 Points
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.