zoukankan      html  css  js  c++  java
  • Sublime Text3 手动 配置 NodeJs 环境

    不会自动配,就手动配

    https://github.com/tanepiper/SublimeText-Nodejs 下载 downzip
    放到,首选项,浏览插件,我的是下面的目录
    D:softSublime Text 3DataPackages
    SublimeText-Nodejs-master.zip
    解压,名称改为SublimeText-Nodejs
    修改

    Nodejs.sublime-settings

    {
    // 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": false,
    
    "expert_mode": false,
    
    "ouput_to_new_tab": false
    }
    

      

    Nodejs.sublime-build

    {
    "cmd": ["node", "$file"],
    "file_regex": "^[ ]*File "(...*?)", line ([0-9]*)",
    "selector": "source.js",
    "shell": true,
    "encoding": "cp936",
    "windows":
    {
    "cmd": ["taskkill","/F", "/IM", "node.exe","&","node", "$file"]
    },
    "linux":
    {
    "shell_cmd": "killall node; /usr/bin/env node $file"
    },
    "osx":
    {
    "shell_cmd": "killall node; /usr/bin/env node $file"
    }
    }

    找到工具,编译系统,选择node.js

    新建test.js

    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(3000);
    
    console.log('Server running at http://127.0.0.1:3000/');

    然后ctrl+B 在浏览器查看 http://127.0.0.1:3000/

    参考教程

    http://www.cnblogs.com/qiaojie/p/5560388.html

    http://www.cnblogs.com/bluesky4485/p/3928364.html

  • 相关阅读:
    directUI
    PyLucene测试成功
    MFC笔记(1)CPaintDC, CClientDC
    sprintf缓冲区溢出
    2.5 攻击示例:对Microsoft C++编译器的攻击 ZZ
    C++笔记(3)类中与类外的运算符重载
    C++笔记(2)public,private,protected关键字
    RTSP协议
    使用虚函数,减少累赘的if/else/switch
    C++笔记(4)成员函数定义在类内与类外
  • 原文地址:https://www.cnblogs.com/baicaocanhua/p/node.html
Copyright © 2011-2022 走看看