基於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.