从VS Code运行nest.js [英] Running nest.js from VS Code
问题描述
因此,我正在使用这个看起来不错的新框架 http://nestjs.com/很棒,因为它允许在Node上使用Typescript,很有可能成角度.
So, I'm playing around with this new framework http://nestjs.com/ who seems pretty awesome since it allows the usage of Typescript on Node, very likely to angular.
使用启动器 https://github.com/kamilmysliwiec/nest-typescript-starter ,我可以使用npm run start
毫无问题地运行它,但是由于项目上有一个.vscode,我假设我可以使用VS Code来运行并获得一些调试功能.
Using the starter https://github.com/kamilmysliwiec/nest-typescript-starter, I can run it with npm run start
without any problem, but since there is a .vscode on the project, I assumed I could use VS Code to run and gain some debug abilities.
问题是,当我直接从VS Code运行而未更改代码中的任何内容时,出现以下问题:
The problem is that when I run directly from VS Code, without changing anything in the code, I get the following problem:
Error: Cannot find module 'nest.js'
我尝试从VS Code运行,而没有从NPM运行,则没有成功.
I tried to run from VS Code with and without it running from NPM, no success.
谢谢.
推荐答案
我今天更新了nest-typescript-starter
.以前的版本具有旧的dist
目录,其中包含已过期的导入软件包.如果要编译应用程序,请使用npm run start:prod
脚本.
I updated nest-typescript-starter
today. The previous version had an old dist
directory, with outdated imported packages. If you want to compile your application, use npm run start:prod
script.
这篇关于从VS Code运行nest.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!