14
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SublimeTextでjavascript実行するまでの環境構築手順(Mac)

Last updated at Posted at 2015-05-09

javascriptのコードをsublimeで
実行→確認したくなった時の環境構築メモです。

前提

以下のサイトを参考にnvmとnode.jsをインストール
http://qiita.com/dribble13/items/e895208727c85ef9bc52

環境

Mac 10.10.3
Sublime Text 3

手順

1.SublimeTextを立ち上げTools>Build System>New Build Systemをします。

2.以下を追記して保存します。
(ファイル名はnode.Sublime-buildとしました)

{
    "cmd": ["node","$file"]
}

3.Preferences>Settings - User で、以下の記述を追加し、nodeのパスを通します

,"build_env": 
{
    "PATH": "/Users/ユーザー名/.nvm/v0.11.16/bin:$PATH"
}

上記手順で環境できあがったと思います^^;

あとは、実行したいファイルを開き
Tools > Build System > node を選択し
command + b とすると
実行結果が画面下部に表示されます。

good luck!

14
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?