Deployment on IIS of Nestjs application

末鹿安然 提交于 2021-01-29 10:37:03

问题


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

npm run start:prod

and

npm run webpack

but failed to deploy on IIS. How can I build a deployment package?? so I can deploy. I am new with nodejs and Nestjs.


回答1:


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

that will re-build your app into the dist folder.

So you can

  1. Zip up the dist folder
  2. deploy to the target host
  3. Unzip it
  4. Try running iisnode on it

let me know how that works



来源:https://stackoverflow.com/questions/53046414/deployment-on-iis-of-nestjs-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!