Tag: visual studio code

VS Code nodej远程debugging

我试图在node.js(7.1.0)项目上使用VS Codebuild立远程debugging。 我用pm2启动我的开发应用程序: { "apps": [{ "name": "my-app-dev", "script": "app.js", "watch": true, "node_args": ["–inspect=9229", "–nolazy"], "ignore_watch": ["assets/images/", ".tmp/", ".git/"], "watch_options": { "usePolling": true } }] } 这是.vscode / launch.json文件: { "version": "0.2.0", "configurations": [ { "type": "node2", "request": "attach", "name": "attach", "port": 9229, "address": "my.app.local", "restart": true, "diagnosticLogging": true, "sourceMaps": false } ] } 当我启动debugging器时,我成功地连接了附加的Debugger […]

使用Visual Studio代码将TypeScript编译为JavaScript

我是NodeJS和TypeScript的新手,我想从设置我的项目文件夹开始。 我已经有我的tsconfig.json { "compilerOptions": { "outDir": "./build", "module": "commonjs", "target": "es5", "noImplicitAny" : false }, "files": [ "./src/**/*.ts" ], "exclude": [ "node_modules" ]} 和package.json { "name": "crm", "version": "1.0.0", "description": "", "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC" } 这是我简单的目录结构: crm/ |-src/ |- main/ […]

如何将Markdown-it-emoji整合到VS Code中

VisualStudio Code通过使用markdown-it对Markdown有很好的支持,并且有一个名为markdown-it-emoji的扩展,允许直接在markdown中使用emojis。 我试图在VS Code中安装它,但是在VS Code Preview中我看不到emojis。 这是我所做的: npm install markdown-it-emoji –save-dev 我的package.json看起来像这样 "devDependencies": { "markdown-it": "^8.3.1", "markdown-it-emoji": "^1.3.0"} 在VS Code中使用markdown-it-emoji我需要做些什么?

只有在开发者机器上需要npm包的types定义吗?

据我所知,types定义模块(对于npm包)为开发人员提供intellisense,以便在调用库方法时不必猜测参数types。 例如,当我在vscode编辑器中使用第三方库(及其types定义模块)时,这些模块在我的打字稿项目中非常有用。 这是唯一的目的(即提供intellisense)的types定义模块? 如果答案是肯定的,那么在构build服务器和生产机器上就不需要它们了。 这是真的?

如何在Visual Studio代码launch.json文件中运行npm脚本

我想在Visual Studio代码的launch.json文件中运行下面的npm脚本: nodemon src/shim-host/index.js –exec babel-node –babel-preset-es2015 我到目前为止在我的launch.json文件中的尝试: "program": "nodemon src/shim-host/index.js –exec babel-node –babel-preset-es2015", 但是,我收到错误"Attribute 'program' is not absolute'" 有人可以帮忙吗? 提前致谢!

找不到模块“爬虫”

在通过npm命令在Node.js(不在默认目录中)中安装node-crawler之后,我尝试运行“ Usage ”部分中的代码,但执行var Crawler = require("crawler");时发生错误var Crawler = require("crawler"); 和VisualStudio代码debugging控制台说Cannot find module 'crawler' 。 这是否发生,因为我在自定义位置安装了crawler ? 我怎样才能解决这个问题?

如何在VSCODE上发布LSP语言服务器,就像我们做扩展一样

已经通过官方网站,整个发布扩展的过程是非常良好的文档: vscode发布扩展 我的疑问是关于在vscode中发布语言服务器(LSP),因为LSP的文件结构不同于扩展的文件结构,即扩展只有客户端,但LSP同时具有客户端和服务器目录,如同LSP代码和扩展代码 。 我是否需要在client和server目录中分别运行vsce publish ? 在这里已经通过各种答案在stackoverflow。 任何帮助将不胜感激。

尽pipe项目位于泊坞窗容器上,但在我的IDE上仍可使用Lintingfunction

我有一个在Docker上运行的React NodeJS项目。 我能够通过在这里发表文章来实现它的工作。 问题是,我的主机中的node_modules是空的。 将volumes更改为/www/project/node_modules:app/node_modules将使模块在/www/project/node_modules:app/node_modules容器中不可用。 我的工作就是通过运行npm install –only=dev只安装在主机上的依赖关系,但是每次重启容器都会消失。 这是我的Github回购的副本,这是做到这一点。

如何使用node.js呈现多个html页面?

要做到这一点: <html> <!– head –> <head> <title>SpaceGame2</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <!– <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> –> <link rel="stylesheet" href="css/spaceGame.css"> <!– <link rel="stylesheet" href="css/normalize.css"> –> <link href="https://fonts.googleapis.com/css?family=Raleway:300,400" rel="stylesheet"> </head> <body> <p class="testing"></p> html page <!– Footer –> <script src="https://unpkg.com/vue"></script> <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> </body> </html> 通过将其分为三个单独的文件head.html,footer.html和main.html。 main.html将有所不同,但其他两个将是相同的。 码: var express = require('express'); […]

是否有可能在Visual Studio代码中分析来自NodeJS程序的内存使用情况

我试着searchstackoverflow和代码github回购。 是否有可能分析node.js程序的内存消耗,在VS代码中debugging?