Compiling Node-expat extensions into Node.exe

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.