node.js - sublime text3 配置nodejs环境,无法编译 no build system

浏览:24日期:2022-09-05

问题描述

刚接触node.js,使用sublime text3配置node.js编译环境一直出现no build system。尝试了网上各种配置,最后均失败,请教是哪里出了问题?谢谢

Nodejs.sublime-build 配置:

{ 'cmd': ['D:Program Filesnodejsnode.exe', '$file'], 'file_regex': '^[ ]*File '(...*?)', line ([0-9]*)', 'selector': 'source.js', 'shell': true, 'encoding': 'utf8', 'windows': {'shell_cmd': 'taskkill', '/F', '/IM', 'D:Program Filesnodejsnode.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 配置:

{ 'save_first': true, 'node_command': 'D:Program Filesnodejsnode.exe', 'npm_command': 'D:Program Filesnodejsnpm.cmd', 'node_path': false, 'expert_mode': false, 'ouput_to_new_tab': false}

编译新系统配置:

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

菜单:工具--编译系统--Nodejs 也有,alt-R 也可运行Nodejs。

但是无法编译,一直提示 no build system

问题解答

回答1:

我不太清楚你具体配置文件的情况,但是有几点需要声明的:

新的编译系统和旧的编译系统不要共存,因为两个都有'selector': 'source.js',所以你不确定它调用的哪一个

新的编译系统配置看起来可用,不过要记得将它放在PackagesUser目录下,而不是Packages目录下

旧编译配置中,windows的值看起来并不像是一个有效的JSON,应该是写错了

建议使用cmd配置替代shell_cmd配置

可能系统调用了旧的配置文件,但由于旧配置文件内容本身是有错的,所以就报错no build system

相关文章: