zoukankan      html  css  js  c++  java
  • sublime配置node开发环境

    下载node插件

    https://github.com/tanepiper/SublimeText-Nodejs

    下载zip压缩包后解压,文件名改为Node

    打开文件“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": "D:\node\node.exe",//node的地址
      // Same for NPM command
      "npm_command": "D:\node\npm.cmd",//cmd的地址
      // as 'NODE_PATH' environment variable for node runtime
      "node_path": false,
    
      "expert_mode": false,
    
      "output_to_new_tab": false
    }

    打开文件“Nodejs.sublime-build”改为如下样子

    {
      "cmd": ["node", "$file"],
      "file_regex": "^[ ]*File "(...*?)", line ([0-9]*)",
      "selector": "source.js",
      "shell": true,
      "encoding": "utf8",
      "windows":
        {
          "shell_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"
        }
    }

    编写一个测试文件app.js,按“ctrl+B"运行代码,运行结果如下图所示

  • 相关阅读:
    vue 初始化项目模板报错
    092117-6265-01.dmp 蓝屏日志文件
    电信流氓注入JS
    DISM
    node.js
    Adobe ZXPInstaller 报错 Installation failed because of a file operation error.
    Microsoft Edge 针对 Web 开发人员更新日志
    What's new in Safari 11.0
    CSS Filter
    accept-language
  • 原文地址:https://www.cnblogs.com/aSnow/p/8847941.html
Copyright © 2011-2022 走看看