`node-gyp build` on Windows always rebuilds the final binary even if no files were changed
See original GitHub issueCloned bufferutil
, ran npm install
and node-gyp rebuild
, then running node-gyp build
:
PS C:\Users\jake\src\bufferutil> node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@3.5.0
gyp info using node@4.2.6 | win32 | ia32
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=Win32' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Creating library C:\Users\jake\src\bufferutil\build\Release\bufferutil.lib and object C:\Users\jake\src\bufferutil\build\Release\bufferutil.exp
Generating code
Finished generating code
bufferutil.vcxproj -> C:\Users\jake\src\bufferutil\build\Release\\bufferutil.node
bufferutil.vcxproj -> C:\Users\jake\src\bufferutil\build\Release\bufferutil.pdb (Full PDB)
gyp info ok
No source files were modified, but it still rebuilds the binaries. On Linux and Mac this would be a no-op as it recognises nothing has changed.
Is this a limitation of gyp itself? Surely msbuild is capable of this. Is there some setting I can put in binding.gyp to override this?
This is an issue because it slows down build scripts with unnecessary rebuilds. We have a fairly big native addon so it adds about 20 seconds.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Solving common issues with node-gyp - LogRocket Blog
Many node-gyp issues are actually issues with the toolchain used for building add-on code. We'll categorize these issues to offer solutions.
Read more >A Comprehensive Guide to Fixing Node-Gyp Issues on Windows
A Comprehensive Guide to Fixing Node-Gyp Issues on Windows · 1. Try running npm install with the --no-optional flag. · 2. Try downloading...
Read more >node.js - Error with npm install - a pre-gyp error - Stack Overflow
I had a similar problem on windows, installing node-gyp globally ... I faced this error when I was running a project which has...
Read more >Errors with node-gyp appearing - Visual Studio Feedback
We have suddenly seen all builds failing with issues around gyp, node, npm, and msbuild calling these. Have the build servers been changed...
Read more >Run Into a NPM Node-gyp Compilation Error on Windows 10 ...
This error can happen when you are installing a number of packages from NPM that depend on binaries being compiled in order for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed by https://github.com/nodejs/node-gyp/compare/c307b30...386746c (https://github.com/nodejs/node-gyp/pull/964)
@joaocgreis Perhaps you can test/review #951 or #964? I think my preference is for the latter.