Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Teachable.

Run a local package – npm

Summary

To run a local package, enter the following command in your terminal:

npx package-name [options/arguments]

Details

To run a package that was installed locally, you need to use the npx command (not npm).

As an example, if you were trying to run the create-react-app package to create a project called my-app, you would enter the following command into your terminal:

npx create-react-app my-app

Exercises

Use the following command to run browser-sync locally:

npx browser-sync . -w

Reference

The npm Blog — Introducing npx: an npm package runner

Back to: npm Reference > npm Local Packages