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

[BUG] Npm install hangs indefinitely #7671

Closed
2 tasks done
alexia312313 opened this issue Jul 19, 2024 · 4 comments
Closed
2 tasks done

[BUG] Npm install hangs indefinitely #7671

alexia312313 opened this issue Jul 19, 2024 · 4 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps

Comments

@alexia312313
Copy link

alexia312313 commented Jul 19, 2024

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Npm hangs indefinitely when installing

npm install --verbose
...
npm http fetch GET 200 https://registry.npmjs.org/@angular/language-service/-/language-service-18.1.1.tgz 4905ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@angular/cdk/-/cdk-18.1.1.tgz 4934ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/nx/-/nx-19.5.1.tgz 4974ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@angular/core/-/core-18.1.1.tgz 5167ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@angular/common/-/common-18.1.1.tgz 5474ms (cache miss)

Either rebooting, clearing the cache npm cache clean --force, or removing package-lock.json worked

With other projects I have, it works, maybe one package is broken.

Update: Interesting, after removing the package-lock.json and doing a npm install on one of my projects
it successfully installed the packages but looking at git changes, the new package-lock.json seems to have
removed this lines of every package

"resolved": "https://registry.npmjs.org/@electron/get/-/get-2.0.3.tgz",
"integrity": "sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ==",

Expected Behavior

succesfully install the packages

Steps To Reproduce

  1. mkdir testdir

  2. cd testdir

  3. npm init (defaults)

  4. edit the package.json and add this lines

"dependencies": {
    "@angular/animations": "^18.1.1",
    "@angular/cdk": "^18.1.1",
    "@angular/common": "^18.1.1",
    "@angular/compiler": "^18.1.1",
    "@angular/core": "^18.1.1",
    "@angular/forms": "^18.1.1",
    "@angular/platform-browser": "^18.1.1",
    "@angular/platform-browser-dynamic": "^18.1.1",
    "@angular/router": "^18.1.1",
    "@capacitor-mlkit/barcode-scanning": "^6.1.0",
    "@capacitor/android": "6.1.1",
    "@capacitor/app": "6.0.0",
    "@capacitor/core": "6.1.1",
    "@capacitor/device": "6.0.0",
    "@capacitor/filesystem": "6.0.0",
    "@capacitor/haptics": "6.0.0",
    "@capacitor/keyboard": "6.0.1",
    "@capacitor/splash-screen": "6.0.1",
    "@capacitor/status-bar": "6.0.0",
    "@capawesome/capacitor-app-update": "6.0.0",
    "@ionic/angular": "^8.2.5",
    "@ionic/storage-angular": "^4.0.0",
    "date-fns": "3.6.0",
    "ionicons": "^7.4.0",
    "lodash": "^4.17.21",
    "ngx-color-picker": "^17.0.0",
    "ngx-socket-io": "^4.7.0",
    "rxjs": "~7.8.1",
    "swiper": "^11.1.5",
    "tslib": "^2.6.3",
    "uuid": "^10.0.0",
    "zone.js": "~0.14.8"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^18.1.1",
    "@angular-eslint/builder": "^18.1.0",
    "@angular-eslint/eslint-plugin": "^18.1.0",
    "@angular-eslint/eslint-plugin-template": "^18.1.0",
    "@angular-eslint/schematics": "^18.1.0",
    "@angular-eslint/template-parser": "^18.1.0",
    "@angular/cli": "^18.1.1",
    "@angular/compiler-cli": "^18.1.1",
    "@angular/language-service": "^18.1.1",
    "@capacitor/cli": "6.1.1",
    "@ionic/angular-toolkit": "^11.0.1",
    "@ngx-translate/core": "^15.0.0",
    "@ngx-translate/http-loader": "^8.0.0",
    "@types/jasmine": "~5.1.4",
    "@types/lodash": "^4.17.7",
    "@types/node": "^20.14.11",
    "@types/uuid": "^10.0.0",
    "@typescript-eslint/eslint-plugin": "^8.0.0-alpha.45",
    "@typescript-eslint/parser": "^8.0.0-alpha.45",
    "@typescript-eslint/utils": "^8.0.0-alpha.45",
    "electron": "^31.2.1",
    "electron-builder": "^24.13.3",
    "electron-debug": "^4.0.0",
    "electron-log": "^5.1.6",
    "electron-reloader": "^1.2.3",
    "eslint": "~9.7.0",
    "eslint-plugin-jsdoc": "^48.7.0",
    "eslint-plugin-prefer-arrow": "1.2.3",
    "jasmine-core": "~5.1.2",
    "jasmine-spec-reporter": "~7.0.0",
    "karma": "^6.4.3",
    "karma-chrome-launcher": "~3.2.0",
    "karma-coverage": "~2.2.1",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.1.0",
    "prettier": "^3.3.3",
    "typescript": "~5.5.3",
    "wait-on": "^7.2.0"
  },

  1. npm install

Environment

  • npm: 10.8.2
  • Node.js: v22.5.0
  • OS Name: archlinux (updated today)
  • Kernel: Linux 6.9.10-arch1-1
  • System Model Name:
  • npm config:
❯ npm config ls
; node bin location = /usr/bin/node
; node version = v22.5.0
; npm local prefix = /home/alexia
; npm version = 10.8.2
; cwd = /home/alexia
; HOME = /home/alexia
; Run `npm config ls -l` to show all defaults.
@alexia312313 alexia312313 added Bug thing that needs fixing Needs Triage needs review for next steps labels Jul 19, 2024
@alexia312313 alexia312313 changed the title [BUG] Npm hangs indefinitely [BUG] Npm install hangs indefinitely Jul 19, 2024
@mchmatt
Copy link

mchmatt commented Jul 19, 2024

I get the same issue if building w/ Docker image node:22.5.0, and can't reproduce it in node:22.4.
Could you try downgrading Node and seeing if you can reproduce it?

@milaninfy
Copy link
Contributor

Closing Seems similer if not duplicate of #7657.
Try node 22.4.1 with npm 10.8.2.

@alexia312313
Copy link
Author

Closing Seems similer if not duplicate of #7657. Try node 22.4.1 with npm 10.8.2.

Yes, downgrading to node 22.4.1 solves the issue, thanks :)

@milaninfy
Copy link
Contributor

Fixed in Node.js v22.5.1 nodejs/node#53902 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

3 participants