search

Home  >  Q&A  >  body text

node.js - sublime text3 configures nodejs environment and cannot compile no build system

I have just come into contact with node.js. When I use sublime text3 to configure the node.js compilation environment, no build system always appears.
I tried various configurations online, but all failed in the end. What is the problem? Thanks

Nodejs.sublime-build Configuration:

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

Nodejs.sublime-settings Configuration:

{
  "save_first": true,
  "node_command": "D:\Program Files\nodejs\node.exe",
  "npm_command": "D:\Program Files\nodejs\npm.cmd",
  "node_path": false,

  "expert_mode": false,

  "ouput_to_new_tab": false
}

Compile new system configuration:

{
    "cmd": ["node", "$file"],
    "selector": "source.js"
}

Menu: Tools--Compilation System--Nodejs is also available, alt-R can also run Nodejs.

But it cannot be compiled, and it keeps prompting no build system

淡淡烟草味淡淡烟草味2778 days ago1666

reply all(1)I'll reply

  • 代言

    代言2017-07-06 10:39:01

    I’m not sure about your specific configuration file, but there are a few things that need to be stated:

    1. Don’t coexist between the new compilation system and the old compilation system, because both have "selector": "source.js", so you are not sure which one it calls

    2. The new build system configuration seems to be available, but remember to place it in the PackagesUser directory instead of the Packages directory

    3. In the old compilation configuration, the value of windows does not look like a valid JSON, it should be written wrong

    4. It is recommended to use cmdconfig instead of shell_cmdconfig

    5. Maybe the system calls the old configuration file, but because the content of the old configuration file itself is wrong, an error is reportedno build system

    reply
    0
  • Cancelreply