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

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?



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1