Debug nodejs bằng chrome:
-
Hiện nay có nhiều tool debug nhưng mình thấy thằng này debug là ok nhất, nó y như những gì mình debug javascript trên browser
- step 1: cài đặt node-inspector
- npm install -g node-inspector
- step 2: vào thư mục project của bạn và chạy lệnh:
- node-debug app.js (app.js là file start app của bạn)
- step 3: node-inspector sẽ tự động mở chrome lên và bạn debug bằng develop tool của chrome
- bạn có thể tìm hiểu sâu hơn tại https://github.com/node-inspector/node-inspector
Chúc các bạn thành công!
- step 1: cài đặt node-inspector