简体   繁体   中英

Why does node.js need python

I am starting up with node This is from node.js README.md

Prerequisites (Unix only):

* GCC 4.2 or newer
* Python 2.6 or 2.7
* GNU Make 3.81 or newer
* libexecinfo (FreeBSD and OpenBSD only)

Curious to know why does node.js need Python ? Does it use Python underneath its API

Node.js is built with GYP — cross-platform built tool written in Python. Also some other build steps are implemented in Python. So Python is required for building node from source.

But you also need Python for building native addons.

Yes, node uses some python scripts under the hood, though Node is largely written in C++.

See some of Node's python code here:

https://github.com/joyent/node/tree/master/tools

Eg, js2c.py converts Javascript into C-style char arrays:

https://github.com/joyent/node/blob/master/tools/js2c.py

In general, if a package tells you that it requires Python, then it is almost certainly using Python ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM