npm install: It is obvious that npm install
is used to install packages using the package.json
file, this command also installs the other packages on which the packages (in package.json
) are dependent.
On the backside, this command uses the npm build
which helps to build the packages you are installing.
npm rebuild: As the name rebuild, this command again builds the packages, used only when you upgrade the node version and must recompile all your C++ addons with the new binary.