Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU, memory, swap usage, freezes with fnm compared to nvm #1336

Open
mifkys opened this issue Nov 28, 2024 · 0 comments
Open

High CPU, memory, swap usage, freezes with fnm compared to nvm #1336

mifkys opened this issue Nov 28, 2024 · 0 comments

Comments

@mifkys
Copy link

mifkys commented Nov 28, 2024

Good day. I am faced with a very strange situation. Node.js 20 LTS is installed on Debian 12 via fnm. Everything was fine until it was necessary to deploy on the server a new project written in Nest in nx. When trying to install the node_modules via "npm i" at the stage
"run [email protected] postinstall node_modules/nx node ./bin/post-install" the system starts to devour 100% of the processor, the memory and swap are completely clogged. All this goes on for a long time (I waited for 15-20-30 minutes) and does not end with anything. I tried installing node via fnm, both under a regular user and under a root - the result is the same. Only forcibly terminate the command helps me.

After that, I decided to try installing node.js via nvm. When executing the same "npm i" command, the installation of the node_modules was successful after 5 minutes. CPU and memory usage was also high, but it went down after a few minutes.

Debian 12 x64
1 GB RAM
1 GB SWAP

Package.json content:

{
  "name": "",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {},
  "private": true,
  "dependencies": {
    "@nestjs/cache-manager": "^2.2.2",
    "@nestjs/class-transformer": "^0.4.0",
    "@nestjs/class-validator": "^0.13.4",
    "@nestjs/common": "^10.0.2",
    "@nestjs/config": "^3.3.0",
    "@nestjs/core": "^10.0.2",
    "@nestjs/jwt": "^10.2.0",
    "@nestjs/platform-express": "^10.0.2",
    "@nestjs/swagger": "^7.4.2",
    "@nestjs/typeorm": "^10.0.2",
    "axios": "^1.6.0",
    "cache-manager": "^5.7.6",
    "cache-manager-redis-store": "^2.0.0",
    "class-transformer": "^0.5.1",
    "class-validator": "^0.14.1",
    "dotenv": "^16.4.5",
    "glob": "^11.0.0",
    "multer": "^1.4.5-lts.1",
    "mysql2": "^3.11.3",
    "node-cache-manager": "^1.2.0",
    "passport": "^0.7.0",
    "passport-jwt": "^4.0.1",
    "passport-local": "^1.0.0",
    "redis": "^4.7.0",
    "reflect-metadata": "^0.1.13",
    "rxjs": "^7.8.0",
    "sharp": "^0.33.5",
    "typeorm": "^0.3.20",
    "typeorm-naming-strategies": "^4.1.0"
  },
  "devDependencies": {
    "@eslint/js": "^9.8.0",
    "@nestjs/schematics": "^10.0.1",
    "@nestjs/testing": "^10.0.2",
    "@nx/eslint": "20.0.3",
    "@nx/eslint-plugin": "20.0.3",
    "@nx/jest": "20.0.3",
    "@nx/js": "20.0.3",
    "@nx/nest": "20.0.3",
    "@nx/node": "20.0.3",
    "@nx/web": "20.0.3",
    "@nx/webpack": "20.0.3",
    "@nx/workspace": "20.0.3",
    "@swc-node/register": "~1.9.1",
    "@swc/core": "~1.5.7",
    "@swc/helpers": "~0.5.11",
    "@types/bcrypt": "^5.0.2",
    "@types/cache-manager": "^4.0.6",
    "@types/cache-manager-redis-store": "^2.0.4",
    "@types/express": "^5.0.0",
    "@types/glob": "^8.1.0",
    "@types/jest": "^29.5.12",
    "@types/multer": "^1.4.12",
    "@types/node": "~18.16.9",
    "eslint": "^9.8.0",
    "eslint-config-prettier": "^9.0.0",
    "jest": "^29.7.0",
    "jest-environment-node": "^29.7.0",
    "nx": "20.0.3",
    "prettier": "^2.6.2",
    "ts-jest": "^29.1.0",
    "ts-node": "10.9.1",
    "tslib": "^2.3.0",
    "typescript": "~5.5.2",
    "typescript-eslint": "^8.0.0",
    "webpack-cli": "^5.1.4"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant