官术网_书友最值得收藏!

Installing from source on POSIX-like systems

Installing the pre-packaged Node distributions is currently the preferred installation method. However, installing Node from source is desirable in a few situations:

  • It could let you optimize the compiler settings as desired
  • It could let you cross-compile, say for an embedded ARM system
  • You might need to keep multiple Node builds for testing
  • You might be working on Node itself

Now that you have the high-level view, let's get our hands dirty mucking around in some build scripts. The general process follows the usual configure, make, and make install routine that you may already have performed with other open source software packages. If not, don't worry, we'll guide you through the process.

The official installation instructions are in the Node wiki at https://github.com/joyent/node/wiki/Installation.

Installing prerequisites

As noted a minute ago, there are three prerequisites, a C compiler, Python, and the OpenSSL libraries. The Node installation process checks for their presence and will fail if the C compiler or Python is not present. The specific method of installing these is dependent on your operating system.

These commands will check for their presence:

$ cc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ python
Python 2.6.6 (r266:84292, Feb 15 2011, 01:35:25)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
主站蜘蛛池模板: 江永县| 科尔| 黑水县| 田林县| 麟游县| 汾西县| 华蓥市| 松江区| 安阳县| 甘谷县| 内丘县| 南木林县| 大同市| 三亚市| 商洛市| 南郑县| 泸水县| 南投县| 台南市| 右玉县| 南皮县| 昌图县| 灯塔市| 泰兴市| 突泉县| 读书| 恩施市| 浦城县| 邹平县| 霍林郭勒市| 江阴市| 玛多县| 花垣县| 香河县| 宁明县| 灵寿县| 易门县| 建宁县| 亚东县| 慈溪市| 华容县|