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

Kayla Johnson
Kayla Johnson
351 Points

http-server command not found

I installed node. which node and which npm both worked - displayed message like /usr/local/bin/npm But when I run http-server I get command not found. I tried to google a way to fix this and ran "npm run serve" and it blew up on me. http://grab.by/PUw4

3 Answers

Seth Kroger
Seth Kroger
56,413 Points

Try the command npm install -g http-server (you may need to use sudo, and/or your admin password).

Seth Kroger
Seth Kroger
56,413 Points

I'm not sure what exactly you're attempting to do or whether this is in regard to a particular video. However you're getting that message because http-server isn't installed. You'll need to install it globally with npm in order to use it on the command line like that.

Kayla Johnson
Kayla Johnson
351 Points

Yes this is for this video https://teamtreehouse.com/library/gulp-basics/welcome-to-gulpjs/installing-gulp I used the Mac guide to install it http://treehouse.github.io/installation-guides/mac/node-mac.html and this is the result I get. There is no mention of installing it globally. Do I have to uninstall the version I installed through this guide?