zoukankan      html  css  js  c++  java
  • sublime配置开发nodejs

    1.下载https://github.com/tanepiper/SublimeText-Nodejs

    2.解压到sublime->Preferences->Browse Packages 打开的目录,然后改名nodejs

    3.重启sublime,选择Tools->Build System->nodejs

    4.打开Preferences->Package Settings->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:in ode.exe"
    "node_command": "C:\Program Files\nodejs\node.exe",
    // Same for NPM command
    "npm_command": "C:\Program Files\nodejs\npm.cmd",
    // as 'NODE_PATH' environment variable for node runtime
    "node_path": "C:\Program Files\nodejs",

    "expert_mode": false,

    "ouput_to_new_tab": false
    }

    5.打开插件包中的Nodejs.sublime-build配置如下:

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

    6 测试 编写如下代码

    var http = require('http');
    var os = require('os');

    http.createServer(function (request, response) {
    response.writeHead(200, {'Content-Type': 'text/plain'});
    response.end('Hello World ');

    }).listen(8124);

    console.log('Server running at http://127.0.0.1:8124/');

    然后按ctrl+B查看

  • 相关阅读:
    vs2010装虚拟机后启动慢
    LINUX FIFO(读书笔记,LINUX程序设计第四版)
    WPF控件 ProgressBar
    C# SQLite操作示列
    win10下使用Linux命令
    类初始化与实例化过程
    结构与类 Delphi
    多线程应用 Delphi
    (珍藏)SQL Server中常用的SQL语句
    获取当前用户本地应用程序设置文件夹 Delphi
  • 原文地址:https://www.cnblogs.com/yfann/p/3662882.html
Copyright © 2011-2022 走看看