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
代言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:
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
The new build system configuration seems to be available, but remember to place it in the PackagesUser
directory instead of the Packages
directory
In the old compilation configuration, the value of windows
does not look like a valid JSON, it should be written wrong
It is recommended to use cmd
config instead of shell_cmd
config
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