「Expressをインストールする」の版間の差分

提供: Node.js/JavaScript入門
移動: 案内検索
(ページの作成:「node.jsExpressをインストールします。 __TOC__ == 概要 == Expressは、npmコマンドでインストールします。 == インストー...」)
 
行7: 行7:
 
== インストール ==
 
== インストール ==
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
$ sudo npm install -g express
+
$ sudo npm install -g express jade
 +
</syntaxhighlight>
 +
== 環境変数の設定 ==
 +
<syntaxhighlight lang="bash">
 +
export NODE_PATH=/usr/local/lib/node_modules
 
</syntaxhighlight>
 
</syntaxhighlight>
 
== 使い方 ==
 
== 使い方 ==

2014年4月5日 (土) 21:41時点における版

node.jsExpressをインストールします。

概要

Expressは、npmコマンドでインストールします。

インストール

$ sudo npm install -g express jade

環境変数の設定

export NODE_PATH=/usr/local/lib/node_modules

使い方

$ express -h
 
  Usage: express [options] [dir]
 
  Options:
 
    -h, --help          output usage information
    -V, --version       output the version number
    -s, --sessions      add session support
    -e, --ejs           add ejs engine support (defaults to jade)
    -J, --jshtml        add jshtml engine support (defaults to jade)
    -H, --hogan         add hogan.js engine support
    -c, --css <engine>  add stylesheet <engine> support (less|stylus) (defaults to plain css)
    -f, --force         force on non-empty directory

関連項目