Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The difference ”npm r build“ and “npm run build”?

Tags:

javascript

npm

Recently I tried to use "npm r build" as a simplified as "npm run build", but I found those two are different. I am wondering what does "npm r build" do?

like image 429
Adam Lee Avatar asked Dec 17 '25 19:12

Adam Lee


1 Answers

Let's check the docs. If you type this:

npm help r
npm help run

… the program will open the corresponding manual pages in your default browser. They're local files thus you don't even need internet connection:

npm-uninstall

Remove a package
SYNOPSIS

npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|-D|--save-dev|-O|--save-optional|--no-save]

aliases: remove, rm, r, un, unlink
npm-run-script

Run arbitrary package scripts
SYNOPSIS

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

alias: npm run

So r is an alias for a different command.

like image 58
Álvaro González Avatar answered Dec 19 '25 08:12

Álvaro González



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!