Tag: visual studio code

如何在Visual Studio代码编辑器中确定群集服务器上的debugging模式

通常在Visual Studio Professional上我们可以在C# #if DEBUG //doing something #else //Release mode doing something #endif 我的NodeJS服务器环境是集群,所以我需要检查debugging模式设置一些variables。 显然我不想把这个'#'来certificatedebugging模式,我只是想知道编辑器是否设置了一些processvariables来检查它。

在TypeScript文件中使用node.d.ts时编译错误

我正在研究我的第一个node.js项目(用于学习的目的),我希望使用TypeScript作为Visual Studio代码的select语言(是的,我不是在寻找简单的方法)。 源代码在这里: https : //github.com/thecoderok/ukrbash-node当我在源代码中引用node.d.ts时,我得到了大量的编译 错误如:urkbash-node \ typings \ node \ node.d.ts(178,36):错误TS1005:';' 预期。 urkbash-node \ typings \ node \ node.d.ts(425,5):错误TS1008:意外的标记; 'module,class,interface,enum,import or statement'expected。 urkbash-node \ typings \ node \ node.d.ts(425,12):错误TS1008:意外的标记; 'module,class,interface,enum,import or statement'expected。 urkbash-node \ typings \ node \ node.d.ts(425,17):错误TS1005:';' 预期。 有谁知道为什么以及如何解决它?

Visual Studio代码 – MongoDB的TypeScript定义

我正在尝试使用Node.js和Express构build一个简单的Web应用程序。 在本指南中显示,使用tsd安装了两个定义之后。 尝试tsd query mongodb –action install它不会得到像zero result或类似的错误,但仍然不能显示在vscode自动完成。 我想如果可以安装MongoDB定义。 可以? 编辑: mongodb.d.ts是在我的项目中mongodb.d.ts typings\mongodb文件夹。

从VS代码附加到NodeJS进程跳过第一条语句

我在VS Code之外启动NodeJS node –debug-brk main.js 这里是main.js的代码 console.log('Hello from child'); console.log('Hello from child2'); console.log('Hello from child3'); 当我使用VS代码附加configurationdebugging器时,在第一条语句上跳过断点。 { "name": "Attach to Node", "type": "node", "address": "localhost", "port": 5858, } 我在Windows 7上运行VS Code 0.8.0。节点版本v0.10.33。 我不知道这是VS代码debugging器的错误还是我的本地环境的问题?

取决于vscode模块的大量npm …?

我刚开始尝试将Ensime scala ide-support集成到vscode中。 我已经从我的primefaces包https://github.com/ensime/ensime-atom取出了一些整合部分到https://github.com/ensime/ensime-node 。 然而,当从vscode取决于这一点,我得到的红色曲线,它不能被发现: 但是,代码仍然生成并运行得很好。 我很担心 我find了这个: 问:我可以使用本机的Node.js模块和我的扩展吗? 答:Visual Studio代码扩展包包含所有的依赖关系。 这意味着,如果您在Windows上开发扩展,并在发布该扩展时依赖于本地Node.js模块,则Windows编译的本地依赖将包含在您的扩展中。 OS X或Linux上的用户将无法使用该扩展。 现在做这个工作的唯一方法是在您的扩展中包含VS代码(Windows x86和x64,Linux,OS X)的所有四个平台的二进制代码,并且具有dynamic加载正确代码的代码。 这是什么意思? 我不能使用fs,net,child_process之类的东西? 有需要他们所有我认为或vscode提供所有通过抽象层?

debugging打破与bunyan.createLogger – 节点v5.8发射

当我尝试使用bunyan启动node.js应用程序时,debugging器会停止,一旦我尝试创buildlogging器。 当我遍历代码时,我可以深入到createLogger并find它的中断点。 在node_modules / bunyan / lib中,debugging器在579行分离 – assert.ok(isWritable(s.stream), '"stream" stream is not writable: ' + util.inspect(s.stream)); debugging器工作,直到我设置logging器,之后,它分离,我永远不会步进到logger.info行。 import bunyan from 'bunyan'; const logger = bunyan.createLogger({ name: 'test' }); //debugger detaches logger.info('Hello logger'); // debugger will NOT step to this line winston不会发生这种情况。 我认为这与winston使用控制台和bunyan使用stream有关。 import winston from 'winston'; winston.info('Simple log'); const bp = 'The debugger will […]

Visual Studio代码和debugging模式

我在path/home/***/Downloads/main.js中有一个小的js文件。 这个文件的内容是: console.log("Hello, world") 我的launch.json文件看起来是这样的: { "version": "0.2.0", "configurations": [ { "name": "Launch", "type": "node", "request": "launch", "program": "${workspaceRoot}/main.js", "stopOnEntry": false, "args": [], "cwd": "/home/matan/Downloads", "preLaunchTask": null, "runtimeExecutable": null, "runtimeArgs": [ "–nolazy" ], "env": { "NODE_ENV": "development" }, "externalConsole": false, "sourceMaps": false, "outDir": null }, { "name": "Attach", "type": "node", "request": "attach", "port": 5858, "address": […]

Visual Studio代码,debugging节点 – 我怎样才能打这个“未经validation的断点”?

我只是开始与节点和VSCode(在某种程度上,JavaScript),所以这可能是一个小学生的错误。 只有一个JavaScript文件writefile.js : var fs = require('fs'); process.stdin.on('data', function (text) { fs.writeFileSync("test.txt", text, 'utf8'); console.log("The file was saved."); process.exit(); }); console.log('what do you want to write?'); 哪个工作正常,没有附加debugging器。 现在我正在尝试debugging – 为了保持简单,我只是手动启动节点在控制台中 node –debug-brk writefile.js 如果我在fs.writeFileSync行上放置了一个断点,当我在Visual Studio Code中附加debugging器时,会收到一条消息,说明它是“未validation的断点”: 其他断点击中罚款。 我期望所有描述的断点都应该在writeFileSync之前被命中,只有在控制台上的用户input之后才能被命中。 我尝试启动节点时使用-nolazy选项 – 但断点仍然显示为未validation,我也得到了一个长时间的暂停,而'evented IO的v8 javascript'在内存使用率上升… 我究竟做错了什么?

VS代码自动重新启动debugging器的文件保存像nodemon

当源文件像nodemon一样变化时,有没有办法在VS Code中自动重启节点debugging器?

在NPM上查看我的自述数据时,每个angular色之间都有一个

我是npm和节点的新手,只是一个业余爱好者。 我想通过npm创build,发布和使用一个模块。 我做了一个很小的math库: https : //www.npmjs.com/package/thombsaway-maths 这里是回购,所以你可以看到README.md呈现在那里: https : //github.com/Thomas-Elder/hobby.node.maths 我想这是一些编码问题,我猜? 我在Windows 10上,写在vscode。