npm install should not build the compiler in local development
Currently, the npm post install script (scripts/install.js) builds ninja and the compiler if they are not present already. This is meant for installation of the finished npm package so that, on platforms without prebuilt binaries, the compiler is built automatically when the npm package is installed.
There was a discussion in https://forum.rescript-lang.org/t/platform-support-and-prebuilt-binaries-postinstall-scripts/3443/9 if this is even needed or if it would be sufficient to provide prebuilt binaries for all platforms that we intend to support.
But even if we keep the "build on install" mechanism as it is, IMHO it should not be what happens when you check out the compiler repo (for compiler development purposes) and run "npm install" there. In this case, I would prefer to really just install the npm dependencies required for development, and run any build commands separately via make, dune etc.
There is already a packages folder in the repo. We could put the package.json as it is intended to go into the finished npm package into packages/rescript, and keep only what's needed for local development in the package.json in the project root.
"on platforms without prebuilt binaries" and also when npm installing a specific commit
Actually I think we should not build the compiler in postinstall at all, see my proposal in #5694.
The compiler is not built from source on npm install anymore in v11/master.