从VS Code运行nest.js [英] Running nest.js from VS Code

查看:264
本文介绍了从VS Code运行nest.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在使用这个看起来不错的新框架 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屋!

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