From 74a40893569df105329944332b7c8db77f235911 Mon Sep 17 00:00:00 2001 From: Max Black Date: Sat, 29 Nov 2025 15:39:58 -0800 Subject: [PATCH] docs: document gypfile field in package.json --- docs/lib/content/configuring-npm/package-json.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/lib/content/configuring-npm/package-json.md b/docs/lib/content/configuring-npm/package-json.md index a68ccf6f6d2cc..e907240074d56 100644 --- a/docs/lib/content/configuring-npm/package-json.md +++ b/docs/lib/content/configuring-npm/package-json.md @@ -511,6 +511,20 @@ The key is the lifecycle event, and the value is the command to run at that poin See [`scripts`](/using-npm/scripts) to find out more about writing package scripts. +### gypfile + +If you have a binding.gyp file in the root of your package and you have not defined your own `install` or `preinstall` scripts, npm will default to building your module using node-gyp. + +To prevent npm from automatically building your module with node-gyp, set `gypfile` to `false`: + +```json +{ + "gypfile": false +} +``` + +This is useful for packages that include native addons but want to handle the build process differently, or packages that have a binding.gyp file but should not be built as a native addon. + ### config A "config" object can be used to set configuration parameters used in package scripts that persist across upgrades.