[Tips]Fix node.js addon build error: "gyp: binding.gyp not found"
基于node-gyp写Node.js native addon的时候,碰到一个很恶心的问题。
调用“node-gyp configure”能成功,再调用“node-gyp”时总会报错,最后发现时系统时间不对。
# Sympton
$ node-gyp configure
$ node-gyp build
make: Entering directory `/home/piaoger/Public/Piaoger/nodeaddon/build'
make: Warning: File `Release/.deps/./Release/nppluginproxy.node.d' has modification time 2.7e+06 s in the future
ACTION Regenerating Makefile
gyp: binding.gyp not found (cwd: /home/piaoger/Public/Piaoger/nodeaddon/build) while trying to load binding.gyp
make: *** [Makefile] Error 1
# Solution
Set correct system time.