{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "远程调试",
"address": "172.16.2.203",
"port": 9229,
"localRoot": "${workspaceFolder}",
"remoteRoot": "C:\\Users\\Administrator\\Desktop\\test-space"
}
]
}
  • 远端js
const http = require('http')

const app = http.createServer((req, res) => {
debugger
const a = 18
const b = 12
const c = a * b

res.end('okok' + c)
})

app.listen(9090, () => console.log(`Server is running at 9090 ...`))

node --inspect=172.16.2.203:9229 Server.js