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!

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

Michael Kalmykov
Michael Kalmykov
8,919 Points

-bash: http-server: command not found

I can't get past the HTTP step. Details below

MKALMYKOV-MAC:starter gulp michael.kalmykov$ http-server -bash: http-server: command not found

NPM init works fine when i do npm start i get : npm ERR! Darwin 15.6.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" npm ERR! node v6.2.2 npm ERR! npm v3.9.5

npm ERR! missing script: start npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request: npm ERR! /Users/michael.kalmykov/Desktop/starter gulp/npm-debug.log

been trying to fix this for 2 hours now. Please help

Michael Kalmykov
Michael Kalmykov
8,919 Points

sudo npm install http-server -g

I've been having this headache with a lot of the command line based treehouse videos.

Please take the effort to consider all contingencies and have solutions ready for them. As students we are all beginners here and have no idea what we're doing. Sites with technical documentation rarely have these more basic functions outlined in a way that makes sense to newbs.

in this particular case I had no idea that http-server is a node module, or that installing npm doesn't come with http-server, or that to install http-server I have to run the above command, or that I need "sudo" to run the above command. Giving more comprehensive and practical context would have saved me 3 hours of youtube + stack overflow + NPM documentation

5 Answers

Yeah, I actually started diving a bit deeper for you and watched some of the video in question. It's not done very well. Most videos on treehouse are done pretty extensively, unfortunately this one isn't and should be addressed.

It seems you've figured it out. I tried to install http-server locally quickly and couldn't get it working first try, but it seems you've found the same command that I found to work for this instance, which is to install it globally with npm like so npm install http-server -g.

You can also find more information on http-server here if you haven't already: https://github.com/indexzero/http-server

Now that I looked on the GitHub repo their using it shows you that you need to install gulp and http-server globally (https://github.com/hdngr/treehouse-gulp-basics). They should really just include this in the video. Or be more clear that there's further instructions to follow on the git page. This might help someone else in the future.

Anyways, good luck the rest of the way :)

I'm not the best person to ask about this, but I thought I would try to help a bit:

Have you tried removing your modules folder and tried running npm init and npm start again?

Michael Kalmykov
Michael Kalmykov
8,919 Points

thanks for responding, apparently 'http-server' is it's own module and has to be installed separately

Michael Kalmykov & Kristofer Doman:

You must install Node.js & then npm (Node Package Manager) first before you attempt to make your own computer your local http-server. Otherwise, you're putting the cart before the horse. Be sure to follow the installation instructions exactly for your operating system (Apple MacIntosh OS X, Windows, or Linux). They should load without any problem.

Thanks Michael. I had my question answered immediately because of you.