Home > Web Front-end > JS Tutorial > body text

Nodejs sublime text 3安装与配置_node.js

WBOY
Release: 2016-05-16 16:43:45
Original
2390 people have browsed it

1) 下载sublime并安装,下载列表:http://www.jb51.net/softs/132432.html

2) 下载sublime的nodejs插件,需是集成Nodejs插件到sublime中,下载地址:https://github.com/tanepiper/SublimeText-Nodejs

3)   解压zip文件, 并重命名文件夹“Nodejs”

4)   打开sublime,操作"preference" --> "Browse packages", 打开一个目录,这个目录是众多语言IDE插件的存放地。

5)   复制”Nodejs“文件夹到这个目录。  这样就可以了吗? 酱样子还不行,还要更改配置文件。

6)   打开Nodejs文件夹,找到文件“Nodejs.sublime-build”, 拖拽到sublime,显示:       

{ 
   "cmd": ["node", "$file"], 
   "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", 
   "selector": "source.js", 
   "shell":true, 
   "encoding": "cp1252", 
   "windows": 
    { 
      "cmd": ["taskkill /F /IM node.exe & node", "$file"] 
    }, 
   "linux": 
    { 
      "cmd": ["killall node; node", "$file"] 
    } 
  }
Copy after login

需要更改上面标注的地方, 要更改encoding为GB2312或者utf8,如果不更改此属性可能导致build nodejs代码时终端显示乱码。

7) 要用sublime打开文件“Nodejs.sublime-settings” 或者 设置“preference” --》 “package settings” --》 “Nodejs” --》“setting-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": /usr/bin/nodejs,
 // Same for NPM command
 "npm_command": /usr/bin/npm,
 // as 'NODE_PATH' environment variable for node runtime
 "node_path": false,

 "expert_mode": false,

 "ouput_to_new_tab": false
}
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!