.
Term | Explanation |
---|---|
Breakpoint | A point in the code where the debugger pauses execution, allowing inspection of the program's state. |
Debugger | A tool providing debugging functionalities, such as stepping through code line by line and inspecting variables. |
Feature (not bug) | A common developer phrase used to jokingly dismiss a reported bug. |
Frequency | How often a bug occurs under specific conditions. |
"It doesn't work" | A vague and unhelpful bug report. |
Log Point | An instruction to the debugger to display a variable's value at a specific point during execution. |
Logging | Outputting runtime information to the console or a file. |
Logic Error | The program runs without crashing, but produces incorrect results. |
Priority | The ranking of a bug's importance in the list of planned updates. |
Race Condition | A hard-to-trace bug caused by the unpredictable sequence or timing of events. |
Refactoring | Rewriting code to improve readability and maintainability. |
Regression | The re-emergence of a previously fixed bug, often due to subsequent code changes. |
Related Bug | A bug similar to or connected to another bug. |
Reproduce | The steps needed to trigger the error. |
RTFM Error | User error disguised as a bug report (Read The Flipping Manual). |
Step Into | In a debugger, execute a function call line by line. |
Step Out | In a debugger, complete the current function's execution and return to the calling code. |
Step Over | In a debugger, execute a command without stepping into any functions it calls. |
Severity | The impact of a bug on the system (e.g., data loss is more severe than a minor UI issue). |
Stack Trace | A historical list of all functions called before an error occurred. |
Syntax Error | Errors caused by typos or incorrect code structure (e.g., console.lug() ). |
User Error | An error caused by user actions, but may still require a fix depending on the user's role. |
Watch | A variable monitored during debugger execution. |
Watchpoint | Similar to a breakpoint, but the program pauses only when a specific variable reaches a particular value. |
레버리지 소스 컨트롤
소스 제어 시스템 (예 : GIT) 트랙 코드가 변경되어 버그가 언제 어디서 도입되었는지 쉽게 식별 할 수 있습니다. Github 및 Bitbucket과 같은 온라인 리포지토리는 편리한 도구와 스토리지를 제공합니다.문제 추적 시스템을 구현하십시오
eslint myfile.js
node.js 디버깅 : 환경 변수
로 설정됩니다. 변수는 Linux/MacOS (), Windows CMD () 또는 Windows PowerShell ()에서 설정할 수 있습니다. 또한 모듈을 사용하여로드 할 수 있습니다.
node.js 디버깅 : 명령 줄 옵션
, 및 가 있습니다 콘솔 디버깅
는 기본이지만 필수 디버깅 도구입니다. 그러나 다른 console
, .dir()
, .table()
, .error()
, .count() 및 를 탐색하십시오. ES6 파괴 구조는 복잡한 객체 로깅을 단순화합니다
node.js .group()
.time()
.trace()
조건부로 STDERR에 메시지를 씁니다. 환경 변수가 적절하게 설정된 경우에만 활성화됩니다. 이를 통해 정상 작동 중에 콘솔을 혼란스럽게하지 않고 코드로 디버그 명세서를 떠날 수 있습니다.
로그 모듈로 디버깅 .clear()
util.debuglog
node.js chrome 로 디버깅
를 사용하려면 검사관을 시작하고 포트 9229에서 듣고 있습니다. 크롬의 를 열고 "검사"를 클릭하여 DevTools를 첨부하십시오. 중단 점을 설정하고 변수를보고 통화 스택을 검사하십시오. 원격 디버깅의 경우 util.debuglog
NODE_DEBUG
node.js vs code 로 디버깅을합니다
자주 묻는 질문 (faqs) node inspect ./index.js
node inspect your-script.js
node inspect-brk your-script.js
문, 디버거 명령을 사용하거나 편집기 홈통 (IDES)을 클릭하십시오.
inspect
를 사용하고 비동기 함수 내에서 중단 점을 설정하십시오.
성능 문제 디버깅? inspect-brk
사용 , flamegraphs 및 프로파일 링 도구와 같은 inspect
.
원격 디버깅? inspect-brk
디버거를 시작할 때 호스트 및 포트 옵션을 지정하고 지역 환경에서 연결하십시오.
위 내용은 Node.js 애플리케이션을 디버깅하는 방법 : 팁, 트릭 및 도구의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!