You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
node-pre-gyp build behavior and documentation discrepancy #902
❓ Question: node-pre-gyp build behavior and documentation discrepancy
While working with node-pre-gyp, I noticed a potential discrepancy between:
The README.md command list
The inline code comments
The actual behavior in source
📌 Context
In the code comments, it says "We map node-pre-gyp build to node-gyp configure build", but in practice, node-pre-gyp build does not trigger node-gyp configure — only node-pre-gyp rebuild does.
However, the README does not mention anything about whether configure is required before running build or rebuild, which could be confusing for users.
Here is the source code:
functionbuild(gyp,argv,callback){// Form up commands to pass to node-gyp:// We map `node-pre-gyp build` to `node-gyp configure build` so that we do not// trigger a clean and therefore do not pay the penalty of a full recompileif(argv.length&&(argv.indexOf('rebuild')>-1)){argv.shift();// remove `rebuild`// here we map `node-pre-gyp rebuild` to `node-gyp rebuild` which internally means// "clean + configure + build" and triggers a full recompilecompile.run_gyp(['clean'],{},(err3)=>{if(err3)returncallback(err3);configure(gyp,argv,(err4)=>{if(err4)returncallback(err4);returndo_build(gyp,argv,callback);});});}else{returndo_build(gyp,argv,callback);}}
🧩 My Questions
Is this behavior intentional?
Would it be possible to:
update the README to explicitly mention the need for configure before build?
clarify the inline comment in build.js to avoid confusion?
Activity