ain*_*hed 8 build amazon-ec2 node.js typescript
我正在使用具有 t2.micro 类型的 AWS EC2 实例,并且尝试使用命令构建使用 typescript 的 REST API,tsc但遇到内存问题。
Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
我尝试使用--max_old_space_size-1024但它没有解决任何问题。
大家有什么建议吗?
小智 -3
昨天我也面临同样的问题。不要尝试在 ec2 实例中构建 REST API。您可以在本地构建它,然后将构建文件(index.js)和package.json放入ec2中。试试这篇文章。https://auth0.com/blog/use-typescript-to-create-a-secure-api-with-nodejs-and-express-getting-started/。然后安装node.js https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-up-node-on-ec2-instance.html。然后通过“npm install”安装依赖项并运行构建文件。在我的例子中,“node index.js”运行。添加流程管理器。
| 归档时间: |
|
| 查看次数: |
9661 次 |
| 最近记录: |