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
I’m not sure about your specific configuration file, but there are a few things that need to be stated:
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 callsThe new build system configuration seems to be available, but remember to place it in the
PackagesUser
directory instead of thePackages
directoryIn the old compilation configuration, the value of
windows
does not look like a valid JSON, it should be written wrongIt is recommended to use
cmd
config instead ofshell_cmd
configMaybe the system calls the old configuration file, but because the content of the old configuration file itself is wrong, an error is reported
no build system