ちょっと前に、FreeBSD9.3にMongoDBをインストールしたので、
今度は、Node.jsとExpressをインストール。
これでMEANスタック環境に必要なものは揃う。
■Node.jsのインストール
portsから、Node.jsをインストール。
root@viola:~ # cd /usr/ports/www/node root@viola:/usr/ports/www/node # ls Makefile files pkg-message distinfo pkg-descr pkg-plist root@viola:/usr/ports/www/node # root@viola:/usr/ports/www/node # make install
■npmのインストール
npmもportsからインストールしようとしたのだが、developerツールのインストールでこける。
仕方がないので、パッケージからインストール。
root@viola:/usr/ports/www/npm # pkg install npm Updating FreeBSD repository catalogue... FreeBSD repository is up-to-date. All repositories are up-to-date. Updating database digests format: 100% The following 1 packages will be affected (of 0 checked): New packages to be INSTALLED: npm: 2.1.16 The process will require 7 MB more space. 1 MB to be downloaded. Proceed with this action? [y/N]: y Fetching npm-2.1.16.txz: 100% 1 MB 481.7k/s 00:03 Checking integrity... done (0 conflicting) [1/1] Installing npm-2.1.16... [1/1] Extracting npm-2.1.16: 100% root@viola:/usr/ports/www/npm #
■Expressのインストール
npmを使って、JavaScriptのフレームワークExpressをインストール。
かなり簡単にインストールできた。
root@viola:~ # npm install express express@4.10.6 node_modules/express tqq utils-merge@1.0.0 tqq merge-descriptors@0.0.2 tqq fresh@0.2.4 tqq cookie@0.1.2 tqq escape-html@1.0.1 tqq range-parser@1.0.2 tqq cookie-signature@1.0.5 tqq finalhandler@0.3.2 tqq vary@1.0.0 tqq media-typer@0.3.0 tqq parseurl@1.3.0 tqq methods@1.1.0 tqq serve-static@1.7.2 tqq content-disposition@0.5.0 tqq path-to-regexp@0.1.3 tqq depd@1.0.0 tqq qs@2.3.3 tqq etag@1.5.1 (crc@3.2.1) tqq debug@2.1.1 (ms@0.6.2) tqq on-finished@2.1.1 (ee-first@1.1.0) tqq proxy-addr@1.0.4 (forwarded@0.1.0, ipaddr.js@0.1.5) tqq send@0.10.1 (destroy@1.0.3, ms@0.6.2, mime@1.2.11) tqq accepts@1.1.4 (negotiator@0.4.9, mime-types@2.0.7) mqq type-is@1.5.5 (mime-types@2.0.7) root@viola:~ #
FreeBSDでも簡単にMEAN環境は作れるな。