Nest js:npm run start 失败 [英] Nest js: npm run start fails
问题描述
我正在尝试创建一个 Nest js 应用程序,但是当我按照他们网站上的步骤操作时,我得到的第一个错误是找不到 ts-node".所以,我安装了那个.我还需要安装几个 typscript 模块(我相信是 typscript 和 tsconfig-paths),当我清除这些错误并运行 npm run start 时,我收到了找不到节点模块 @nestjs/core"的提示.
I'm trying to create a Nest js application, but when I follow the steps on their website, the first error I get is 'cannot find ts-node'. So, I installed that. There were a couple more typscript modules I needed to install (typscript and tsconfig-paths I believe) and when I cleared those errors up and run npm run start I got a 'Cannot find node module @nestjs/core'.
推荐答案
一旦使用 typescript,就必须安装它,以便能够使用 tsc
命令,该命令将转译您的代码到 javascript.
As soon as you are working with typescript you have to install it in order to be able to use the tsc
command which will transpille your code to javascript.
当您想即时处理转译时,您还需要安装 ts-node
.这就是您需要它的原因.
you also need to install ts-node
when you want to work with a transpillation on the fly. that's why you need it.
最后,您缺少安装必要的软件包才能使用此网址中列出的 nest:https://docs.nestjs.com/
Finally, you missing to install the necessary packages to be able to work with nest which are listed at this url: https://docs.nestjs.com/
使用以下命令:$ npm i --save @nestjs/core @nestjs/common rxjs 反射元数据
实际上,您缺少了 @nestjs/core
以及基本的 @nestjs/common
包.
Actually, you are missing the @nestjs/core
as well as the @nestjs/common
packages which are fundamental.
这篇关于Nest js:npm run start 失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!