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
Patrick Metcalfe
Courses Plus Student 7,563 Pointsnpm modules
I know there are probably better places to ask this but I like this forum, so I'll ask here. Info:
- 15' Macbook Pro Late-2013
- OS X Mavericks Fully Updated(As of June 17 2014)
- Use Terminal
I install many npm modules to $HOME (AKA /~) and have no problem–take Grunt for example. They install and I can use them, but I recently installed a module ( atom's highlights ) and when I typed in highlights on the command line it said "command not found." I went looking and found that unlike the other ones I installed which were in /.npm this one installed to /node_modules and is the only one in there. Can someone explain to me the problem. I ran it just like atom's page said to and noticed that unlike other modules that went to /.npm I didn't use sudo this time (because it installed fine without it). I would say I understand the command line and computers pretty well but am not as versed on how npm installs work. Any enlightenment would be awesome! Thanks.
1 Answer
Aaron Graham
18,033 PointsDid you install with 'npm install highlights -g'? Given the fact that you didn't have to sudo to install the package, I'm guessing that it wasn't installed globally (the -g option). npm install -g installs modules in your path, leaving out the -g installs them locally in './node_modules'.