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

General Discussion

NPM

Hello Everyone, I have seen a lot about npm that you can also install this using npm in different sites but actually don't know what is npm. Can anyone tell me what is npm? Please

For example, when I visit https://necolas.github.io/normalize.css/ it says "npm install normalize.css" how it works and how to use it?

1 Answer

Ari Misha
Ari Misha
19,323 Points

Hiya there! NPM stands Node package manager. As the title suggests, it install third party packages, dependencies , tools and everything you need for your project , and the best part is that it does it from your command line. If you're coming from other languages like Python or Ruby, its similar to pip or gem in Ruby. NPM also run your dependencies stored on your local machine or root of your project. NPM comes with Node. Whenever you'd want to install a tool or dependency that you might need for your project you can just say npm install <dependency-name>. For more commands and further information on npm and what it can do, just type this in your command line npm --help, it'll throw some commands that you play around with with all the descriptions. Of course there are many package managers out there like yarn, gulp, grunt etc. These are just one of the tools to help you out but npm rules 'em all.

~ Ari

Hey, can you help me by showing an example or giving me any link through I can see some examples and learn NPM.

Ari Misha
Ari Misha
19,323 Points

Sure sohail khab! You know react, right? Its a library created by folks at Facebook which lets you implement UIs in your project. Now lets just say you wanna integrate React to your exisiting project, right? All you have to do is cd to the root your folder and type this following npm install --save react. Now --save is an argument which says you'd like to save it to your project rather than install it globally. npm goes out fetch that data and install it in your project. If you want to look for additional commands for your npm install, you could type this in your terminal npm install --help.and npm will show you arguments you can apply to the installation of your project. I hope it helped. (:

nico dev
nico dev
20,364 Points

Yours, Ari Misha , should be an answer not a comment, so this question looks answered... and also so I can upvote it |o|.

Also, I'd like to add a comment with this link to a workshop on npm that might expand a little further. And if you're feeling ambitious, this one take it even further.