Help us understand the problem. What is going on with this article?

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

More than 3 years have passed since last update.

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!

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away