npm / cli

the package manager for JavaScript
https://docs.npmjs.com/cli/
Other
8.33k stars 3.06k forks source link

[BUG] npm install <package> not completing #7655

Closed Carol-cs closed 1 month ago

Carol-cs commented 1 month ago

Is there an existing issue for this?

This issue exists in the latest npm version

Current Behavior

I’m encountering an issue with installing npm packages in my project. Although I can run the project using npm, I’m unable to install any new packages. (I got a bunch of http fetch GET 200, but the install process never ends...). This problem started yesterday, and despite trying various solutions found online, I haven’t been able to resolve it. Here are the commands I’ve already tried without success:

npm config set registry https://registry.npmjs.org/

npm config set registry http://registry.npmjs.org/ --global

npm cache clear --force

npm config set loglevel info

npm install --versbose

npm config rm proxy
npm config rm https-proxy                        
sudo npm install -g npm@latest                   

rm -rf node_modules package-lock.json           

npm install npm@latest -g  

sudo chown -R 501:20 "/Users/carolma/.npm"       

rm -rf ~/.npm   
rm -rf node_modules                                                                                             
rm -f package-lock.json                          

sudo chown -R `whoami` /usr/local

I don’t believe there’s a network issue since the URL like https://registry.npmjs.org/@cyntler%2freact-doc-viewer (the package I tried to install) can be accessed through web browser and curl command, but I still can’t diagnose the problem. I’ve attached two debug logs: one from running npm install &> text.txt and one from trying to install a package. npm_install.txt debug_log.txt

Expected Behavior

The expectation is that packages can be installed successfully in a short period of time.

Steps To Reproduce

  1. In this environment... os Darwin 23.5.0 node v20.11.1 npm v10.8.2

  2. Run 'npm install &> test.txt'

  3. See error

npm verbose cli /usr/local/bin/node /usr/local/bin/npm npm info using npm@10.8.2 npm info using node@v20.11.1 npm verbose title npm install npm verbose argv "install" npm verbose logfile logs-max:10 dir:/Users/carolma/.npm/_logs/2024-07-17T00_28_57_301Z- npm verbose logfile /Users/carolma/.npm/_logs/2024-07-17T00_28_57_301Z-debug-0.log npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-win32-x64-msvc npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-win32-ia32-msvc npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-win32-arm64-msvc npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-linux-x64-gnu npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-linux-x64-musl npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-linux-powerpc64le-gnu npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-linux-riscv64-gnu npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-linux-s390x-gnu npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-linux-arm64-musl npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-linux-arm64-gnu npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-linux-arm-musleabihf npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-android-arm64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-linux-arm-gnueabihf npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-darwin-arm64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@rollup/rollup-android-arm-eabi npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/win32-x64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/win32-ia32 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/win32-arm64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/openbsd-x64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/sunos-x64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/linux-x64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/netbsd-x64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/linux-s390x npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/linux-riscv64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/linux-ppc64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/linux-loong64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/linux-mips64el npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/linux-ia32 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/linux-arm64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/linux-arm npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/freebsd-x64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/freebsd-arm64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/darwin-arm64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/android-x64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/android-arm64 npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/android-arm npm verbose reify failed optional dependency /Users/carolma/Desktop/project/frontend/node_modules/@esbuild/aix-ppc64 npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm http fetch GET https://registry.npmjs.org/react-icons/-/react-icons-5.2.1.tgz attempt 1 failed with FETCH_ERROR npm http fetch GET 200 https://registry.npmjs.org/react-icons/-/react-icons-5.2.1.tgz 73668ms attempt #2 (cache miss) npm info run esbuild@0.20.2 postinstall node_modules/esbuild node install.js npm info run esbuild@0.20.2 postinstall { code: 0, signal: null }


### Environment

- npm: 10.8.2
- Node.js: 20.11.1
- OS Name: Darwin 23.5.0
- System Model Name: Macbook Pro
- npm config:
```ini
; "user" config from /Users/carolma/.npmrc

fetch-timeout = 60000
loglevel = "verbose"
progress = true
registry = "https://registry.npmjs.org/"
strict-ssl = false

; node bin location = /usr/local/bin/node
; node version = v20.11.1
; npm local prefix = /Users/carolma/Desktop/CPSC455/project/project-07_beyondscope/frontend
; npm version = 10.8.2
; cwd = /Users/carolma/Desktop/CPSC455/project/project-07_beyondscope/frontend
; HOME = /Users/carolma
; Run `npm config ls -l` to show all defaults.
milaninfy commented 1 month ago

@Carol-cs if it's possible, could you please provide package name, package.json or lock file for which this issue is happening? It would give us direction to reproduce this issue if it's happening every time on install.

ElRobinson commented 1 month ago

@Carol-cs I experienced the same thing today. I tried using NVM with a different Node version, and it worked.

desjardinsalec commented 1 month ago

I was having infinite loading issues on v22.5.0 when running npm i.

I upgraded to v22.5.1 and no issues.

milaninfy commented 1 month ago

Closing: this error can arise for a number of reasons; Please read [this document](https://github.com/npm/cli/wiki/%22cb()-never-called%3F-Exit-handler-never-called%3F-I'm-having-the-same-problem!%22) & refile an issue with as much information as possible if you're able to consistently reproduce this error.

@Carol-cs if it's possible, could you please provide package name, package.json or lock file for which this issue is happening? It would give us direction to reproduce this issue if it's happening every time on install.