您好,我正在尝试在VSCode中设置断点并使用Chrome调试器。我的仓库有一个运行在http://localhost.lmig.com:3000/上的Node JS服务器。
我需要运行的主要npm命令是npm start。
我的节点版本是6.10.0。我的本地操作系统是Mac OSX,我将zsh与NVM一起使用。到目前为止,我的launch.json是这样的:
configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost.lmig.com:3000/",
"webRoot": "${workspaceFolder}"
},{
"type": "node",
"request": "launch",
"name": "Launch via NPM",
"runtimeExecutable": "npm",
"runtimeVersion": "6.10.0",
"runtimeArgs": [
"run-script",
"start",
"--debugger=3000"
],
"port": 3000,
"restart": true,
"protocol": "legacy",
"remoteRoot": "0.0.0.0:3000",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
// "outFiles": ["${workspaceRoot}/build/**/*.js"],
"sourceMaps": true
}
我的package.json是这样的:
它在集成终端中运行节点进程,但似乎仍未达到我的断点。
请帮助
答案 0 :(得分:0)
仅提供此作为替代启动配置,但这是我使用的。
您可能需要将“协议”更改回 $loop = mysqli_query($conn, "SELECT channelid, videoId FROM users ORDER BY id")
or die (mysqli_error($conn));
while ($row = mysqli_fetch_array($loop))
{
$url = 'https://www.googleapis.com/youtube/v3/search?order=date&part=snippet&channelId='.$row['channelid'].'&maxResults=3&key=KEY';
$content = file_get_contents($url);
$json = json_decode($content, true);
foreach($json['items'] as $row)
{
$channelid = $row['snippet']['channelId'];
$videoId = $row['id']['videoId'];
$videoId1 = $row['id']['videoId'];
$videoId2 = $row['id']['videoId'];
$sql = "INSERT INTO users(channelid, videoId, videoId1, videoId3) VALUES('$channelid', '$videoId', '$videoId1', '$videoId2')
ON DUPLICATE KEY UPDATE channelid='$channelid', videoId='$videoId', videoId1='$videoId1', videoId2='$videoId2';
";
mysqli_query($conn, "SET NAMES utf8");
if(!mysqli_query($conn,$sql))
{
die('Error : ' . mysqli_error($conn));
}
}
}
$conn->close();
?>
...,因为您使用的是旧版本的节点。
legacy