14
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Vagrant上のNodeアプリをChromeの開発者ツールでデバッグ

Posted at

日本語の記事で探したけど見つからなかったので。

仮想マシンのポートフォワーディング設定

Vagrantfile

  config.vm.network :forwarded_port, guest: 3001, host: 3001

node-inspectorインストール・実行

$ npm i -g node-inspector
$ node --debug ./bin/www

↑とは別プロセスで以下を実行


$ node-inspector --web-port=3001
Visit http://127.0.0.1:3001/debug?ws=127.0.0.1:3001&port=5858 to start debugging.

いんすぺくたーさんに言われた通り、
http://127.0.0.1:3001/debug?ws=127.0.0.1:3001&port=5858
にchromeでアクセスしてやると開発者ツールが動くのであとは煮るなり焼くなり。

参考サイト

14
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?