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

JavaScript Gulp Basics Welcome to Gulp.js Installing Gulp

kabir k
PLUS
kabir k
Courses Plus Student 18,036 Points

Getting errors running npm install in the terminal

In the terminal, I have been getting errors running:

npm install

I followed the "Quick Start" instructions on github

https://github.com/hdngr/treehouse-gulp-basics

7 Answers

Ryan Niswonger
Ryan Niswonger
4,742 Points

Under teacher's notes, the instructions are incorrect. We are directed to checkout the "Stage3Video1" branch however it does not contain a package.json file so running "npm install" as instructed gives the error: "Couldn't read dependencies".

Yep there is no package.json. Guess we can try to copy it over from the master branch.

I have confirm that this works. Simply run

git checkout master

and copy the package.json file onto your desktop. Then run

git checkout Stage1Video3

and copy the package.json file from your desktop into the project folder and voila :) Now you can run npm install with no errors

You can also checkout particular files from another branch in git like so:

git checkout master -- package.json

Very handy for Huston's courses, so you don't have to always change to a whole other branch for every new video.

As for the install errors, try using sudo npm install -g gulp before you even clone the repo or run npm install.

I tried

npm install -g gulp

I tried this 10 times finally worked.

kabir k
kabir k
Courses Plus Student 18,036 Points

Thanks, I didn't realize you have to try it 10 times for it to work. Do you know why it requires that number of tries?

I just added sudo to the front of ellie's code and it worked the first time. Thanks ellie!

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

I didn't actually try 10 times, after the 3rd time, I just ignored the errors and so far... I'm on the last part of the course and haven't had any problems following along.

So, in my opinion, I wouldn't worry about the errors, because so far there hasn't been a negative impact on my course work.

The error in the teacher notes relies in the order in which the commands are indicated, you have to npm installbefore the checkout, so in order to make it work, yo first have to install the dependencies:

npm install

And then checking out to the specified git tag

git checkout Stage1Video3

If you've already checking out you can return to the master by typing:

git checkout master

=====

This answers is based on what Ryan and Jeff pointed out.

=== UPDATE === If you got this error, it's pretty likely that you tried to install the site before ending de video, if you follow along the video, the teacher shows how to create the package.json file which is the cause of the error

Darryn Smith
Darryn Smith
32,043 Points

I'm a big fan of Treehouse, and I appreciate and respect Huston's knowledge and jitsu-fu...

But someone needs to revisit the QC on Huston's courses, whether Treehouse has a team of QC people or places the burden on the instructors themselves.

I just finished Express Basics and this kind of nonsense is becoming par for the course with this particular instructor. Teachers' notes out of order, missing repo files, non-existent branches... this should all be ironed out before the course is launched.

Furthermore, in the case that an error of some kind slips through to release, why isn't it fixed after four months, usuallly more?

Enrico Imbalzano
Enrico Imbalzano
2,879 Points

True Jason, I had errors running the npm install as well, but ignoring them didn't have negative side effects on the rest of the project: everything is running smooth (up to this moment)