Skip to content

Instantly share code, notes, and snippets.

@uupaa
Last active April 4, 2017 13:06
Show Gist options
  • Select an option

  • Save uupaa/2ccdfa0097ad265f93ac to your computer and use it in GitHub Desktop.

Select an option

Save uupaa/2ccdfa0097ad265f93ac to your computer and use it in GitHub Desktop.
Node.js install and settings

install

HomeBrew をインストールした状態で、 node.js の v0.12をインストールします。

node の最新版を利用したいところですが、 node.js に付属している npm の最新版には package.json を改変する不具合があり、WebModuleを安全にビルドできるバージョンが node.js v0.12 に付属している npm になります。

この制限は将来のWebModuleで解決する予定です。

brew search node

> leafnode
> llnode
> node
> node-build
> node@0.10
> node@0.12
> node@4
> node@6
> nodebrew
> nodeenv
> nodenv

brew install node@0.12         // 一緒に npm もインストールされます

node --version
> v0.12.18

npm --version
> 2.15.11

次に、NODE_PATH をシェルの設定ファイル(例: .zshrc)に追記します。

echo 'export NODE_PATH="/usr/local/lib/node_modules"' >> ${HOME}/.zshrc
source ${HOME}/.zshrc
env | grep NODE_PATH

> NODE_PATH=/usr/local/lib/node_modules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment