Home > Web Front-end > JS Tutorial > Nodejs sublime text 3 installation and configuration_node.js

Nodejs sublime text 3 installation and configuration_node.js

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

1) Download sublime and install it, download list: http://www.jb51.net/softs/132432.html

2) Download the nodejs plug-in for sublime. You need to integrate the Nodejs plug-in into sublime. Download address: https://github.com/tanepiper/SublimeText-Nodejs

3) Unzip the zip file and rename the folder "Nodejs"

4) Open sublime, operate "preference" --> "Browse packages", and open a directory, which is where many language IDE plug-ins are stored.

5) Copy the "Nodejs" folder to this directory. Is this enough? If it still doesn't work, you still need to change the configuration file.

6) Open the Nodejs folder, find the file "Nodejs.sublime-build", drag it to sublime, it will display:

{ 
   "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
You need to change the places marked above. You need to change the encoding to GB2312 or utf8. If you do not change this attribute, it may cause the terminal to display garbled characters when building nodejs code.

7) To use sublime to open the file "Nodejs.sublime-settings" or set "preference" --》 "package settings" --》 "Nodejs" --》 "setting-default" Open the file and change it to:

{
 // 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