Sam
Sam

Reputation: 6610

What is the difference between npm run-script and npm run?

I've seen references to both npm run <task> and npm run-script <task>. What's the difference?

There are lots of posts on here about the difference between e.g. npm build and npm run build, but I've not found anything that compares run and run-script.

Upvotes: 1

Views: 1053

Answers (1)

Sam
Sam

Reputation: 6610

npm run is an alias for npm run-script, so they're the same.

You can see this in the docs at https://docs.npmjs.com/cli/run-script

You can also work this out by running npm help run. The start of the output you'll get is:

NAME
       npm-run-script - Run arbitrary package scripts

   Synopsis
         npm run-script <command> [--silent] [-- <args>...]

         alias: npm run

Upvotes: 4

Related Questions