- 安装node.js
- 查看是否安装成功
node -v npm -v
添加build system
Tools -> Build System -> New Build System
{ "cmd": ["node", "$file"], "selector": "source.js" }
- 保存为nodejs.sublime-build
- 编写测试文件
console.info('hello'); for (let i = 0; i < 10; i++) { console.log('i = ', i); }
ctrl + b 运行控制台打印