windows下配置Sublime Text 2開發Nodejs

來源:互聯網
上載者:User

標籤:

1 下載 Sublime Text 2 
http://www.sublimetext.com/

2 下載Nodejs外掛程式,下載ZIP包 
https://github.com/tanepiper/SublimeText-Nodejs

3 解壓ZIP,重新命名為Nodejs

4 將Nodejs複製到C:\Users\Administrator\AppData\Roaming\Sublime Text 2\Packages目錄下

5 重啟Sublime Text 2 ->Tools-->Build System -->Nodejs

6 配置nodejs的path Preferences-->Package Setting-->Nodejs-->Default,附我的配置如下

{
  // save before running commands
  "save_first": true,
  // if present, use this command instead of plain "node"
  // e.g. "/usr/bin/node" or "C:\bin\node.exe"
  "node_command": "D:\\tools\\nodejs\\node.exe",
  // Same for NPM command
  "npm_command": "D:\\tools\\nodejs\\npm.cmd",

  "expert_mode": true,

  "ouput_to_new_tab": false
}

7 C:\Users\Administrator\AppData\Roaming\Sublime Text 2\Packages\nodejs\Nodejs.sublime-build進行修改,附我修改內容如下:

{
  "cmd": ["D:\\tools\\nodejs\\node.exe", "-p", "$file"],
  "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
  "selector": "source.js",
  "shell":true,
  "encoding": "GB2312",
  "windows":
    {
     "cmd": ["D:\\tools\\nodejs\\node.exe", "$file"]
    },
  "linux":
    {
        "cmd": ["killall node; node", "$file"]
    }
}

8 好了配置好開發工具就可以進行開發了。

我們在編輯器建立一個js 檔案,ctrl+b運行或在 Tools->nodejs -> run就可以運行了。

windows下配置Sublime Text 2開發Nodejs

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.