Author - StudySection Post Views - 19 views

Can Sublime Text be used with Node.js?

Yes, Sublime Text provides support for Node.js. So we can run nodejs app in Sublime Text.

  1. Install Sublime Text:

    • Install Sublime Text using official apt repository (or you can say Install GPG key):
      wget -qO – | sudo apt-key add –
    • Add the apt repository (Stable or Dev), we are using stable:
      echo “deb apt/stable/” | sudo tee /etc/apt/sources.list.d/sublime-text.list
    • Check updates:
      sudo apt-get update
    • Install sublime-text:
      sudo apt-get install sublime-text
    • Verify whether Sublime Text is installed properly using the following command:
      subl –version
  2. Install Node.js:

    • Run the following command to install the Node.js package:
      sudo apt install nodejs
    • Set variable path using following command if not set:
      ln -s /usr/bin/nodejs /usr/bin/node
    • Verify whether Node.js is installed properly using the following command:
      node –version
      The output should be like this:


    • Now install the Node Package Manager(npm), using the following command:
      sudo apt install npm
    • Verify whether npm is installed properly using the following command:
      npm –version
      The output should be like this:


  3. Make changes in Sublime Text settings as mentioned below to run Node.js in Sublime Text:

    • Open the Command Palette in Sublime Text using:
    • Type (for “Package Control: Install Package”):
    • Type:
    • Nodejs will be listed click on it to install.
    • Go to Preferences -> Package settings -> nodejs -> settings user
    • Now change the value of “node_command”: false, to “node_command”: “/usr/local/bin/node”
  4. Write a nodejs hello world program, save the file & build it to run it in sublime text.

    • Create a server.js file write the following code & save the file.

      var http = require("http");
      http.createServer(function (request, response) {
      // Send the HTTP header
      // HTTP Status: 200 : OK
      // Content Type: text/plain
      response.writeHead(200, {'Content-Type': 'text/plain'});
      // Send the response body as "Hello World"
      response.end('Hello World\n');
      // Console will print the message
      console.log('Server running at');

    • Press Ctrl+B to build the node js file. Now you can see in sublime text node js server has started.


If you need to prove your skills in the .NET framework, get .NET certified on StudySection. StudySection provides .NET Certification Exam for beginners as well as experts in the .NET framework. This .NET certification can improve your resume’s success rate.

Leave a Reply

Your email address will not be published. Required fields are marked *