Server : nginx/1.20.1 System : Linux ccpf-production-2021 5.4.0-148-generic #165-Ubuntu SMP Tue Apr 18 08:53:12 UTC 2023 x86_64 User : forge ( 1000) PHP Version : 7.4.21 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/doc/nodejs/guides/ |
# Building Node.js with Ninja The purpose of this guide is to show how to build Node.js using [Ninja][], as doing so can be significantly quicker than using `make`. Please see [Ninja's site][Ninja] for installation instructions (Unix only). [Ninja][] is supported in the Makefile. Run `./configure --ninja` to configure the project to run the regular `make` commands with Ninja. For example, `make` will execute `ninja -C out/Release` internally to produce a compiled release binary, It will also execute `ln -fs out/Release/node node`, so that you can execute `./node` at the project's root. When running `make`, you will see output similar to the following if the build has succeeded: ```console ninja: Entering directory `out/Release` [4/4] LINK node, POSTBUILDS ``` The bottom line will change while building, showing the progress as `[finished/total]` build steps. This is useful output that `make` does not produce and is one of the benefits of using Ninja. Also, Ninja will likely compile much faster than even `make -j4` (or `-j<number of processor threads on your machine>`). You can still pass the number of processes to run for [Ninja][] using the environment variable `JOBS`. This will be the equivalent to the `-j` parameter in the regular `make`: ```bash JOBS=12 make ``` ## Producing a debug build To create a debug build rather than a release build: ```bash ./configure --ninja --debug && make ``` [Ninja]: https://ninja-build.org/