Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5962

Deploying Express JS (TypeScript) server on Digital Ocean Ubuntu Droplet (1GB Memory, 256 Disk)

$
0
0

I am trying to deploy my Express JS (Typescript) server on a Digital Ocean Ubuntu Droplet (1GB Memory, 256 GB Disk Space).

I have already deployed two other Express JS servers in the same droplet and both are working fine. They are both lightweight so they are not consuming much memory or disk space which I have checked myself.

The Problem I am facing is that whenever I try to build my project it runs into an error with code 137, which basically means out of memory .I deployed this same server in the Render Platform Free Plan which gives 512MB Memory and it was successful.

So my confusion is if i need to add more memory in my droplet or is there something wrong with my configuration. This is my package.json file :

{"name": "backend","version": "1.0.0","description": "","main": "index.js","scripts": {"start": "node --max_old_space_size=1024 dist/index.js","dev": "nodemon --exec ts-node index.ts","build": "tsc"  },"keywords": [],"author": "","license": "ISC","devDependencies": {"@types/aws-sdk": "^2.7.0","@types/bcrypt": "^5.0.2","@types/cookie-parser": "^1.4.6","@types/cors": "^2.8.17","@types/express": "^4.17.21","@types/jsonwebtoken": "^9.0.5","@types/multer": "^1.4.11","@types/multer-s3": "^3.0.3","@types/node": "^20.11.17","nodemon": "^3.0.3","ts-node": "^10.9.2","typescript": "^5.3.3"  },"dependencies": {"@aws-sdk/client-s3": "^3.514.0","@types/express-session": "^1.18.0","@types/mongoose": "^5.11.97","@types/passport": "^1.0.16","@types/passport-google-oauth20": "^2.0.14","@types/passport-local": "^1.0.38","axios": "^1.6.7","bcrypt": "^5.1.1","body-parser": "^1.20.2","connect-redis": "^7.1.1","cookie-parser": "^1.4.6","cors": "^2.8.5","cryptr": "^6.3.0","dotenv": "^16.4.3","express": "^4.18.2","express-session": "^1.18.0","express-validator": "^7.0.1","google-auth-library": "^9.6.3","googleapis": "^133.0.0","http-errors": "^2.0.0","ioredis": "^5.3.2","jsonwebtoken": "^9.0.2","moment": "^2.30.1","mongoose": "^8.1.2","multer": "^1.4.5-lts.1","passport": "^0.7.0","passport-google-oauth20": "^2.0.0","passport-local": "^1.0.0","puppeteer": "^22.3.0","puppeteer-extra": "^3.3.6","puppeteer-extra-plugin-stealth": "^2.11.2"  }}

And this is my tsconfig.json file :

{"compilerOptions": {"target": "ES2019","module": "commonjs","strict": false,"esModuleInterop": true,"skipLibCheck": true,"forceConsistentCasingInFileNames": true,"outDir": "./dist","rootDir": "./","skipDefaultLibCheck": true,"noEmitOnError": true,"incremental": true    },"include": ["index.ts"],"exclude": ["node_modules"]  }

To run the build command I have used both npm and yarn but I run into the same issue with both. Please let me know where i am going wrong.


Viewing all articles
Browse latest Browse all 5962

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>