How to run node app with sublime text

前端 未结 6 852
旧巷少年郎
旧巷少年郎 2021-02-03 12:38

How would you run node app with sublime text? Like this, open the file app.js in sublime, go to menu->tools->build, and it just runs. Simple like that

6条回答
  •  忘掉有多难
    2021-02-03 12:56

    Cmd+Shift+P , search for "Nodejs::Default File Settings" ,it will open file "Node.js.sublime-settings". you'll see:

    {
      // save before running commands
      "save_first": true,
      // if present, use this command instead of plain "node"
      // e.g. "/usr/bin/node" or "C:\bin\node.exe"
      "node_command": false,
      // Same for NPM command
      "npm_command": false,
    
      "expert_mode": false,
    
      "ouput_to_new_tab": false
    }
    

    modify

    "node_command": false,

    to

    "node_command": "/usr/local/bin/node",

    if the node path is not the same with above, find it and change to yours.

提交回复
热议问题