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.

JavaScript npm Basics Installing Packages with npm Installing Global Packages

Andrew Phythian
Andrew Phythian
19,747 Points

Trouble installing http-server globally

I've installed it locally, but I'm getting the access error when I try to install globally.

I already had npm installed but when I read the guide for using homebew I went ahead and installed homebrew too. Presumably I have two installations of node but something is stopping it from installing globally.

Any help is appreciated.

Seokhyun Wie
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Seokhyun Wie
Full Stack JavaScript Techdegree Graduate 21,593 Points

Hi Andrew, It's already been 4 months you've asked and most likely I guess you've already found an answer. I've tried several solutions that are posted on Stack Overflow or through the link given here onTreehouse, but most them didn't work for me. I found one solution and it worked for me perfectly, using SUDO(Super User DO) option (you can execute a command as a superuser)

$ sudo npm install http-server -g

and it'll ask you to type in your password, after you type it, it should work. Hope you find it helpful.