问题描述
我尝试将我的Nestjs部署在IIS服务器上.我已经在 IIS 上配置了 iisnode ,它对 express应用程序可以 fine 起作用,但是由于 missing我遇到了错误用于Nestjs的模块.我已经尝试按照以下命令来构建生产包
I have tried to deploy my Nestjs deploying on IIS server. I have configured iisnode on IIS that works fine for express application but I am getting errors for missing modules for nestjs. I have tried following commands for building production package
和
,但是无法在IIS上部署.如何构建部署程序包?这样我就可以部署.我是nodejs和Nestjs的新手.
but failed to deploy on IIS. How can I build a deployment package?? so I can deploy. I am new with nodejs and Nestjs.
推荐答案
查看项目的package.json.您将看到start:prod是一个脚本,该脚本在项目的编译输出上运行节点.您可以通过运行以下命令获得编译后的输出:
Look at the project's package.json. You'll see that start:prod is a script that runs node on the compiled output of the project. You get the compiled output by running:
npm run prestart:prod
这会将您的应用重新构建到dist文件夹中.
that will re-build your app into the dist folder.
所以你可以
- 压缩dist文件夹
- 部署到目标主机
- 解压缩
- 尝试在其上运行iisnode
让我知道它的工作原理
这篇关于在Nestjs应用程序的IIS上部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!