npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Are npm-build docs out of date?

It says…

This is the plumbing command called by npm link and npm install.
It should generally be called during installation […]

But at least with npm v6.4.1, build is not triggered by install.

I also tried searching high and low for whether I’m not seeing something and what other people write about it but the official docs are the only place I could find where this behavior is mentioned.

build is absolutely run by install, it’s the thing that’s responsible for making cli binaries available. The direct call into build.js is here:

The action is added to the list of things done here:

And that action actually run here:

What made you think it wasn’t run?

Hang on a second… CLI binaries? So… is there a combination of what “build” does internally as well as running the user’s “build” script if there’s one defined?

Also, in the docs, it says one can manually trigger it with npm run-script build. But based on the description, one should also be able to do the same using npm build . - which does something else though.