question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`node-gyp build` on Windows always rebuilds the final binary even if no files were changed

See original GitHub issue

Cloned 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:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bnoordhuiscommented, Feb 15, 2017

@joaocgreis Perhaps you can test/review #951 or #964? I think my preference is for the latter.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found