Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
There are two ways to install an npm package. When a package is frequently used, it may be helpful to install it in a location where it is accessible to multiple projects. When a project relies on a package it's best to install the package in that project.
Terminal Commands
- Clear the screen
clear
npm Command Line Usage
-
Get help for a command
npm <command> -h
- e.g.
npm install -h
-
Installing a global package
-
npm install <package_name> -g
- e.g.
npm install http-server -g
-
-
Installing a local package
-
npm install <package_name>
- e.g.
npm install express
-
Documentation
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up