Macの下でsublimeはnodeのコンパイル環境を構築します.
1627 ワード
which node -> /usr/local/bin/node
which npm -> /usr/local/bin/npm
Nodejs.sublime-build
{
"cmd": ["node", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.js",
"shell":true,
"encoding": "cp1252",
"windows":
{
"cmd": ["taskkill /F /IM node.exe & node $file"]
},
"linux":
{
"cmd": ["killall node; node $file"]
},
"osx":
{
"cmd": ["killall node; /usr/local/bin/node $file"]
// "cmd": ["killall node; node $file"]
}
}
Nodejs.sublime-settings
{
// save before running commands
"save_first": true,
// if present, use this command instead of plain "node"
// e.g. "/usr/bin/node" or "C:\bin
ode.exe"
"node_command": "/usr/local/bin/node",
// Same for NPM command
"npm_command": "/usr/local/bin/npm",
// as 'NODE_PATH' environment variable for node runtime
"node_path": false,
"expert_mode": false,
"ouput_to_new_tab": false
}
bin/sh node common not found問題を完璧に解決します.