1, download node source code https://github.com/joyent/node (v:0.10.25)
2, download Node-expat source code Https://github.com/node-xmpp/node-expat
3. Because Node-expat relies on Nan, the Nan source code is also downloaded (it is not yet known how to remove Nan dependencies) Https://github.com/rvagg/nan
4. Copy the Nan.h from Nan Project to the node project SRC directory and modify the Node.gyp file to add Src/nan.h.
5, copy the Libexpat in the Node-expat Project Deps folder to the Deps folder of the node project, and modify NODE.GYP add Deps/libexpat/libexpat.gyp:expat
6. Copy the file node-expat.cc in the Node-expat project to the node project SRC directory and change the file name to nodeexpat.cc, modify Node.gyp file add Src/nodeexpat.cc
7, copy the file Node-expat.js in the Node-expat project Lib directory to the node project Lib directory and change the file name to Expat.js. Open expat.js file with text editor modify source code
var expat = require ('.. /build/release/node_expat.node ');
To
var expat = require (' expat ');
8, add the reference to the NODE.GYP