Tag: debugging

在debugging节点脚本时有没有办法将文件加载到Chrome

目前可以使用Chrome来debugging节点脚本,如下所述。 但是,如果我这样运行: node –inspect –debug-brk myscript 它只会将myscript加载到浏览器,并且可以在这个文件中放置断点。 但是,假设myscript需要一个脚本,我想在这个脚本中放一个断点。 由于Chrome检查器只加载了myscript所以我不明白这是如何实现的。 在脚本中需要这些文件之前,有什么方法可以将文件加载到Chrome检查器中,Chrome本身会加载它? 我目前正在修改源和debugger; 声明那里工作。 但是我在想这应该是更适合这个目的的东西。

npm在Windows上运行“DEBUG = *”问题

{ "name": "apokidsi", "version": "0.717", "contributors": [ ], "dependencies": { "angular": "1.5.8", "angular-cookies": "1.5.8", "angular-messages": "1.5.8", "angular-ui-router": "1.0.0-beta.3", "debug": "^3.0.0", "flag-icon-css": "2.8.0", "jquery": "3.2.1", "moment": "2.18.1", "moment-timezone": "0.5.13", "node-fetch-npm": "^2.0.1" }, "scripts": { "clean": "gulp clean", "start": "DEBUG=true HOST=localhost:4200 gulp server", } } 这是package.json文件。 当我运行npm run start 我得到这个消息 “DEBUG”不被识别为内部或外部命令,可操作程序或batch file。 npm ERR! 代码ELIFECYCLE npm ERR! […]

debugging节点应用程序的错误

我最近克隆了一个Web应用程序(Node.js / Express + React),我试图debugging。 我已经尝试使用节点debugging器,并试图使用我的WebStormconfiguration在debugging模式下运行应用程序。 我在这两种情况下看到的错误如下: Unhandled rejection SyntaxError: Unexpected reserved word at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:373:25) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) 这是我的package.json脚本部分的一部分 "main": "server.js", "scripts": { "start": "webpack && babel-node server.js", "test": "grunt test", "build": "grunt build", "all": "npm run build && […]

如何debugging与Mocha运行的Eclipse中的Javascriptunit testing?

我可以用这个命令运行我的Mocha / Unit.jsunit testing: mocha fooTest.js 我想在Eclipse中设置断点并debugging这个unit testing,但是我只在Eclipse中看到以下debuggingconfiguration选项。 有没有办法在Eclipse的debugging模式下执行摩卡unit testing? 我正在使用Eclipse的JavaScript和Web开发人员氧气释放(4.7.0) 。 也许有一个插件,我可以安装或者可能创build一个node.jsdebuggingconfiguration,并使其与摩卡运行? 或者有没有办法在IntelliJ IDE中做到这一点?

VSCodedebuggingNode.js与debugging适配器中的ES6未处理的错误

我正在使用Visual Studio代码来debugging用ES6编码的Node.js程序。 我使用babel来编译ES6到ES5,并且一切正常,代码工作正常,当我运行它没有debugging。 说到debugging,出现了一个问题。 有3个文件: index.js import hello from './imported'; import hello2 from './imported2'; const h = hello(); const h2 = hello2() console.log(h); console.log(h2); imported.js function hello() { return 'hello world'; }; export default hello; imported2.js function hello2() { return 'hello world again'; } export default hello2; 这是我的launch.js { "version": "0.2.0", "configurations": [ { "type": […]

无法安装节点检查器

我试着在两台不同的Windows 10机器上进行安装,这两台机器都具有pipe理权限和节点v8.6.0。 + python 3.6.3 amd64。 两个失败都有相同的错误: C:\Users\kians>npm install -g node-inspector > v8-profiler@5.7.0 preinstall C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-profiler > node -e 'process.exit(0)' > v8-debug@1.0.1 preinstall C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug > node -e 'process.exit(0)' C:\Users\kians\AppData\Roaming\npm\node-inspector -> C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\bin\inspector.js C:\Users\kians\AppData\Roaming\npm\node-debug -> C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\bin\node-debug.js > v8-debug@1.0.1 install C:\Users\kians\AppData\Roaming\npm\node_modules\node-inspector\node_modules\v8-debug > node-pre-gyp install –fallback-to-build node-pre-gyp ERR! Tried to download(404): https://node-inspector.s3.amazonaws.com/debug/v1.0.1/node-v57-win32-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for v8-debug@1.0.1 […]

glob.sync不匹配../path/*.js模式

嘿,我正在尝试遍历节点js中使用glob.sync的一组文件。 它工作完美的罚款 glob.sync('./path/*.js').forEach(function(file){ //code }); 但我想将此文件移动到另一个文件夹,然后执行此操作 glob.sync('../path/*.js').forEach(function(file){ //code }); 代码在这里失败,callback没有得到执行,这不支持在glob或我做错了请帮助

无法将debugging器附加到Docker Node 8.9.x

我们使用VSCode或Chrome DevTools(chrome:// inspect)在Docker容器(6.12.0)上运行和debuggingNodeJS应用程序,没有任何问题。 将debugging器附加到基于新的LTS版本8.9.x的NodeJS容器停止工作(debugging器附加超时)。 VSCode和Chrome DevTools的附加行为都是一样的。 同样的行为在Windows 10和MacOS(高Siera),最新的Docker安装上都是可重现的。 Dockerfile看起来像这样 FROM node:8.9.1-slim ENV PORT=8080 RUN mkdir /usr/src/app WORKDIR /usr/src/app COPY ./ /usr/src/app RUN npm i CMD ["node", "–inspect", "bin/www"] 用于运行容器的命令(公开debugging9229和Web服务器8080端口) docker run –rm -p 9229:9229 -p 8080:8080 –name docker_debug docker_debug 演示应用程序是简单的NodeJS快速应用程序使用快速生成器工具bootstraped。 VSCode启动configuration附加正在运行的Docker应用程序看起来像这样 { "version": "0.2.0", "configurations": [ { "name": "Docker: Attach to Node", "type": "node", "request": […]

winston只有在debugging时才将日志保存到文件中

我在快递应用程序中使用winston。 当我使用node app.js winston运行应用程序时,只logging到控制台,但是如果我使用VSCodedebugging器运行应用程序,它也应该logging到error.log文件。 我正在使用winston v2.3.1,无法升级。 我的代码: const logger = new winston.Logger({ transports : [ new winston.transports.Console(), new winston.transports.File({ filename : './app/error.log', handleExceptions: true, humanReadableUnhandledException: true }) ], handleExceptions : true }); 会是什么呢?

Node.js 8.9.1debugging不能与Netbeans 8.2一起使用

我正在尝试使用netbeans来设置一个node.js项目,并且一切似乎都很顺利,直到我想要试用debugging器…经过一段时间的Googlesearch后,我发现Netbeans论坛上没有回复post: https://forums.netbeans.org/topic67911.html 这正是我遇到的问题。 有没有人有一些信息或解决方法或任何方式来使debugging器的工作?