如何使用Vagrant设置Node-Inspector? [英] How to setup node-inspector with vagrant?

查看:75
本文介绍了如何使用Vagrant设置Node-Inspector?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在无业游民的盒子上运行了一个meanjs应用程序.我的vagrantfile如下

I have an meanjs application running on a vagrant box. My vagrantfile is as follows

 config.vm.network "forwarded_port", guest: 27017, host: 27016 #mongodb
 config.vm.network "forwarded_port", guest: 1337, host: 1338 #node inspector

 config.vm.network "private_network", ip: "192.168.33.10"

节点检查器配置如下

'node-inspector': {
  custom: {
    options: {
      'web-port': 1337,
      'web-host': 'localhost',
      'debug-port': 5858,
      'save-live-edit': true,
      'no-preload': true,
      'stack-trace-limit': 50,
      'hidden': []
    }
  }
},

每当我无法在主机上运行节点检查器

I am not able to get the node inspector working on my host machine whenever

http://192.168.33.10:1338/debug?port=5858

有了流浪汉,我就可以使节点检查器在没有流浪汉的情况下在本地计算机上工作

with vagrant I am able to get the node-inspector working on the local machine without vagrant

推荐答案

我认为问题出在为

I figured the problems was the number of concurrent tasks configured for grunt-concurrent module. By default its equal to the number of cores in the pc. In my case it was two. So My node-inspecter module configuration in gruntfile.js

 concurrent: {
  default: ['nodemon', 'watch'],
  debug: ['node-inspector', 'nodemon', 'watch'],
  options: {
    logConcurrentOutput: true,
    limit: 5
  }

在超链接中也没有调试.应该.

There is also no debug in the hyperlink .It should be.

http://192.168.33.10:1337/?port=5858

两个端口都需要端口转发才能获得节点检查器

Port forwarding was required for both the ports to get the node inspector

config.vm.network "forwarded_port", guest: 1337, host: 1337   
config.vm.network "forwarded_port", guest: 5858, host: 5858

这篇关于如何使用Vagrant设置Node-Inspector?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆