简体   繁体   English

使用 Docker 调试 WebStorm Node.js

[英]WebStorm Node.js debug with Docker

I'm trying to debug a Node.js script with WebStorm 2019.3 and Docker as a remote Node interpreter.我正在尝试使用 WebStorm 2019.3 和 Docker 作为远程 Node 解释器来调试 Node.js 脚本。 So far I can start the script, debug it, but any changes done on local do not trigger a nodemon restart of the script inside the Docker container (files inside the container ARE actually changing, I've checked).到目前为止,我可以启动脚本,调试它,但是在本地所做的任何更改都不会触发 Docker 容器内脚本的 nodemon 重新启动(容器内的文件实际上正在更改,我已经检查过)。

Any ideas?有任何想法吗? I'll attach the WebStorm run config.我将附上 WebStorm 运行配置。

I think there is something wrong about the way that I'm using nodemon when starting the script, but I have no idea how to fix it for WebStorm config.我认为我在启动脚本时使用 nodemon 的方式有问题,但我不知道如何为 WebStorm 配置修复它。

在此处输入图片说明

在此处输入图片说明

Looks like you might need to enable legacyWatch .看起来您可能需要启用legacyWatch

According to the documentation :根据文档

In some networked environments (such as a container running nodemon reading across a mounted drive), you will need to use the legacyWatch: true which enables Chokidar's polling.在某些网络环境中(例如运行 nodemon 读取已安装驱动器的容器),您将需要使用legacyWatch: true来启用 Chokidar 的轮询。

Via the CLI, use either --legacy-watch or -L for short: nodemon -L通过 CLI,使用 --legacy-watch 或 -L 简称: nodemon -L

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM