【问题标题】:How to configure nodejs build plugin inside Sublime Text 3如何在 Sublime Text 3 中配置 nodejs 构建插件
【发布时间】:2018-06-16 21:43:35
【问题描述】:

我正在尝试配置此插件: https://github.com/tanepiper/SublimeText-Nodejs 在 Sublime Text 3 中。

我将此设置作为默认设置:

{
  // 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,
  // as 'NODE_PATH' environment variable for node runtime
  "node_path": true,

  "expert_mode": false,

  "output_to_new_tab": false
}

然后我有我的用户设置:

{
  "node_path": "C:/Program Files/nodejs/"
}

我还检查了路径中的节点,可以全局访问。我使用的是 Windows 10,但输出仍然显示此插件找不到 node.exe:

错误:找不到进程“node.exe”。模块.js:557 抛出错误; ^

有人可以帮我吗?谢谢!

【问题讨论】:

    标签: node.js sublimetext3


    【解决方案1】:

    NODE_PATH 用于设置 Nodejs 将搜索要在您的代码中导入的模块的路径(请参阅:https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders

    如果你想设置 Nodejs 可执行文件的路径,你应该使用node_command 选项而不是node_path。此外,在 Windows 上,您应该使用反斜杠作为路径分隔符而不是正斜杠。

    【讨论】:

      猜你喜欢
      • 2015-06-26
      • 1970-01-01
      • 1970-01-01
      • 2021-01-08
      • 1970-01-01
      • 1970-01-01
      • 2014-02-13
      • 2017-07-16
      • 2018-07-03
      相关资源
      最近更新 更多