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] "sill idealTree buildDeps" takes a lot of time a project with workspaces #3257

Closed
1 task done
midudev opened this issue May 18, 2021 · 54 comments
Closed
1 task done
Labels
Bug thing that needs fixing perf For performance related issues Priority 2 secondary priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@midudev
Copy link

midudev commented May 18, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

After executing npm install the sill idealTree buildDeps step takes a long time (minutes) causing npm@7 working with workspaces slower than npm@6 installing projects separately.

It seems that is fetching packages sequentially instead using parallelization.

Vídeo with the demo:

CleanShot.2021-05-18.at.16.07.23.mp4

Expected Behavior

npm install on npm@7 with workspaces takes less time than npm@6 installing manually each workspace.

Steps To Reproduce

  1. In a environment with a lot of dependencies and workspaces.
  2. With this config:
  "workspaces": [
    "domain",
    "icons",
    "literals"
  ],
  1. Run npm install
  2. See that the step buildDeps take longer than expected.

Some considerations:

  • We're using some npm private packages on our package.json.
  • Workspaces are dependencies of root project as well.

More info:
On Travis, builds using npm@6 and installing workspaces manually takes 90s.
Using npm@7 it takes 170s using a single npm install.

Environment

  • OS: macOS 11.3.1
  • Node: 16.1.0
  • npm: 7.17.0
@midudev midudev added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels May 18, 2021
@midudev
Copy link
Author

midudev commented May 18, 2021

I can't provide a example project as it's a commercial project with full of private dependencies but If there's some log or something I could try to give you, feel free to tell me how to extract it.

@midudev
Copy link
Author

midudev commented Jun 17, 2021

Tried latest version 7.17.0. Still happening.

@kumarrishav
Copy link

I am still facing the slowness on latest npm v7 and v8

@vdawg-git
Copy link

vdawg-git commented Nov 27, 2021

What helped me was to completely uninstall node and then to reinstall it with nvm.
However, I dont know if this is going to happen again.

Edit: Okay, it happens again.

@midudev
Copy link
Author

midudev commented Nov 28, 2021

@V-Dawg this is happening in Travis as well. I think it's something related with the way of resolving the tree.

@EduApps-CDG
Copy link

EduApps-CDG commented Dec 11, 2021

Tried with yarn and npm (v8.1.4 and v8.3.0), also the same thing happens.
But it's working on 7.19.1

@EduApps-CDG
Copy link

EduApps-CDG commented Dec 11, 2021

This bug is critical for me. It's so slow that causes ETIMEDOUT even on a empty project.

image

Update:

After running for a while, npm returns:

npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/natural failed, reason: connect ETIMEDOUT 2606:4700::6810:1223:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/eduardo/.npm/_logs/2021-12-11T07_56_48_769Z-debug.log

But when I go to https://registry.npmjs.org/natural, it loads pretty fast, so I don't think it's a network problem.

@ruyadorno ruyadorno added perf For performance related issues Priority 2 secondary priority issue and removed Needs Triage needs review for next steps labels Mar 1, 2022
@AndrewRayCode
Copy link

AndrewRayCode commented Mar 16, 2022

Same issue I think?

npm install
⸨⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⸩ ⠦ idealTree:myrepo: sill idealTree buildDeps
nvm ls
       v14.17.0
->     v16.11.1
npm --version
8.0.0

Edit, just updated to

⸨#########⠂⠂⠂⠂⠂⠂⠂⠂⠂⸩ ⠙ idealTree:auth0-configuration: timing idealTree:#root Completed in 493084ms

@brayanmf
Copy link

brayanmf commented Apr 5, 2022

installing react with npx or installing packages for backend :,c

Aborting installation.
  npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... package.json
Deleting frontend/ from M:\nodeB\principal\list-to-task2
Done.
PS M:\nodeB\principal\list-to-task2> mkdir backend
PS M:\nodeB\principal\list-to-task2\backend> npm i dotenv 

added 1 package, and audited 2 packages in 969ms

found 0 vulnerabilities
PS M:\nodeB\principal\list-to-task2\backend> npm i express
PS M:\nodeB\principal\list-to-task2\backend> l idealTree buildDeps 

@PedroLuisBernardos
Copy link

I tried all the solutions I found on the Internet: removing the proxy, setting the ssl cert to false, removing node_modules, removing the package-lock... nothing worked...

Then, I updated my WSL Ubuntu 20.04 to 22.04 and it worked!

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt install update-manager-core
sudo nano /etc/update-manager/release-upgrades

change the Prompt value to Prompt = lts

sudo do-release-upgrade -d
cat /etc/os-release

for more info see this link

@sonnystark
Copy link

I tried all the solutions I found on the Internet: removing the proxy, setting the ssl cert to false, removing node_modules, removing the package-lock... nothing worked...

Then, I updated my WSL Ubuntu 20.04 to 22.04 and it worked!

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt install update-manager-core
sudo nano /etc/update-manager/release-upgrades

change the Prompt value to Prompt = lts

sudo do-release-upgrade -d
cat /etc/os-release

for more info see this link

This worked for me. It took a few hours but now everything is working as it should again. Clean slate. Thanks a lot for this @PedroLuisBernardos !!!

@sytandas
Copy link

sytandas commented Aug 7, 2022

npm set strict-ssl false

works for me

@EmmanDizon
Copy link

suddenly encountered this kind of issue again.
I had this node app running, then eventually when i run npm i, the installation hangs only.

even if i tried creating new empty project, i tried installing one package, it hangs too.

what seems to be the problem?

i have tried also the solutions provided on stack overflow and on this, still not work.

@Harshalingole
Copy link

suddenly encountered this kind of issue again. I had this node app running, then eventually when i run npm i, the installation hangs only.

even if i tried creating new empty project, i tried installing one package, it hangs too.

what seems to be the problem?

i have tried also the solutions provided on stack overflow and on this, still not work.

What you have tried to resolve that isssue? I am stuck now.

@nicholastn1
Copy link

nicholastn1 commented Aug 30, 2022

I've tried so many ways to run npm install but doesn't work. If you're in a react application, try to use the yarn package running the following command yarn install or just yarn. It worked for me.

And if you're using a corporation network, try to use an wireless signal (Wi-fi).

@iMonZ
Copy link

iMonZ commented Sep 16, 2022

I tried all the solutions I found on the Internet: removing the proxy, setting the ssl cert to false, removing node_modules, removing the package-lock... nothing worked...
Then, I updated my WSL Ubuntu 20.04 to 22.04 and it worked!

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt install update-manager-core
sudo nano /etc/update-manager/release-upgrades

change the Prompt value to Prompt = lts

sudo do-release-upgrade -d
cat /etc/os-release

for more info see this link

This worked for me. It took a few hours but now everything is working as it should again. Clean slate. Thanks a lot for this @PedroLuisBernardos !!!

Yeah you should definitely upgrade to 22.04
I would just set the "Prompt = normal" instead of LTS.
Otherwise, the deps will be pretty old.

@aiqingr
Copy link

aiqingr commented Sep 30, 2022

npm set strict-ssl false

works for me

@abr4xas
Copy link

abr4xas commented Oct 18, 2022

I can confirm the same issue:

Environment
OS: macOS Monterey 12.6
Node: v17.8.0
npm: 8.5.5

@midudev
Copy link
Author

midudev commented Oct 19, 2022

I've moved the project to pnpm and now it's using a decent amount of time.

I'm closing the issue as I don't think there's no special interest on this. :)

@midudev midudev closed this as completed Oct 19, 2022
@guschiavon
Copy link

After all the cache clearing and folder deletion, good ol' machine restart done the trick...

@Nimaw
Copy link

Nimaw commented Dec 18, 2022

I can confirm the same issue:

Environment
OS: macOS Ventura 13.1
Node: v19.3.0
npm: 9.2.0

@haydenyoung
Copy link

Same issue.

Environment
OS: Ubuntu Linux 22.04
Node: v18.12.1
npm: 8.19.2

Node and NPM installed through NVM.

I have tried everything on this thread without success.

npm set strict-ssl false does not fix the issue.

I have also tried node 16 with same hang.

I cannot downgrade any further than 16 because it breaks min requirements on some packages.

Running npm doctor and there are no reported ping issues so not a connection issue.

@danpalmieri
Copy link

[Solved!]
In my case was I am using a wifi connection with a WPA password (not secure).
Changed to my personal 4G (WPA2/3) and now is working again. =/

@rebelmachina
Copy link

For me it worked to delete the proxy with

npm config delete proxy

and also making sure that registry.npmjs.org is reachable, ie.

ping registry.npmjs.org

@lospringliu
Copy link

one of the reason is IPV6.

@devdomsos
Copy link

devdomsos commented Jan 5, 2023

Same issue

MacOs
node: 18.12.0
npm: 8.19.2

Switched to my personal G4 from Wifi and it worked. wtf

@juan-gd
Copy link

juan-gd commented Jan 20, 2023

As @lospringliu said, turning off IPV6 ended up fixing the issue for me.

@mek1986
Copy link

mek1986 commented Jan 21, 2023

npm set strict-ssl false

为我工作

thank you. This command is useful.

@zlican77
Copy link

npm config set proxy null

npm config set https-proxy null

it will be ok!

@oninsomnus
Copy link

oninsomnus commented Feb 9, 2023

npm set strict-ssl false

npm config set proxy null

npm config set https-proxy null

This worked for me on Windows 11, node v18.12.1 and npm 8.19.2

@itsyaelx
Copy link

I just needed to disable IPV6 :) Tys for your advice guys

@kztera
Copy link

kztera commented Mar 10, 2023

npm set strict-ssl false

npm config set proxy null

npm config set https-proxy null

Work for me on Win 11, node v19.7.0, npm 9.6.0 👍

@Thomas-4Dev
Copy link

same here, thank u guys :)

@SteynGuelen
Copy link

npm set strict-ssl false

and removing yarn.lock worked for me.

@cgomezu
Copy link

cgomezu commented Apr 12, 2023

In my case for the same issue solve the problem this command.

npm config delete proxy

@ImAmelie
Copy link

ImAmelie commented Apr 15, 2023

If IPv6 is not available:

echo "alias npm4='node --dns-result-order=ipv4first /usr/bin/npm'" >> ~/.bashrc
source ~/.bashrc

usage:

npm4 install package_name

@7zx
Copy link

7zx commented Apr 22, 2023

in my case disabling ipv6 solved the problem:

sudo nano /etc/sysctl.conf

Add the following lines at the end of the file:

# Disable IPv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Apply the changes by running the following command:
sudo sysctl -p

Verify that IPv6 has been disabled by running the following command:
ip a | grep inet6

@lucasrpatten
Copy link

node --dns-result-order=ipv4first /usr/bin/npm

This worked for me (running kali linux)

@DevoWarr
Copy link

```js
npm config set https-proxy null

This worked, legend!

@paulpacaud
Copy link

I encountered this issue when my internet connexion was bad, but once I connected in Ethernet, it resolved the hanging point.

@muneebrana23
Copy link

I faced this issue also and after spending few hours I came to know it something related to proxy. I was connected with company vpn, I disconnected proxy and execute
Npm install
And it started working.
Make sure you are not connected with any proxy.

@esoyke
Copy link

esoyke commented Jul 27, 2023

For me it worked to delete the proxy with

npm config delete proxy

and also making sure that registry.npmjs.org is reachable, ie.

ping registry.npmjs.org

My firewall was blocking registry.npmjs.org.

@yogaxv
Copy link

yogaxv commented Aug 9, 2023

I just needed to disable IPV6 :) Tys for your advice guys

thanks this works for me

@yapinxxx
Copy link

yapinxxx commented Aug 28, 2023

If IPv6 is not available:

echo "alias npm4='node --dns-result-order=ipv4first /usr/bin/npm'" >> ~/.bashrc
source ~/.bashrc

usage:

npm4 install package_name

This worked for me. Thanks!
I disabled the IPv6 DNS, which allowed me to successfully use npm install -g (package).


Env:
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy

6.2.0-26-generic

@oliver-nagy
Copy link

For me it worked ignoring the .npmrc file

C:\Users\your_user search for .npmrc and rename it as you wish in my case I renamed it like this .npmrc_ and it worked.

YESSSS, thanks. nothing else worked

@khaledmousa95
Copy link

For me it worked by connecting to a diffrenet WIFI network

@UmairSaqibBhutta
Copy link

I think its solution is to uninstall and install the node again.
This works for me.

@thinkycx
Copy link

My solution:
1、update /etc/hosts

104.16.30.34 registry.npmjs.org

2、ping registry.npmjs.org

3、DEBUG=* npm install -g asar

@Cthousand
Copy link

For me it worked ignoring the .npmrc file

C:\Users\your_user search for .npmrc and rename it as you wish in my case I renamed it like this .npmrc_ and it worked.

对我来说,它的工作忽略.npmrc文件

C:\Users\your_user搜索.npmrc并重命名它,因为你希望在我的情况下,我重命名它像这样.npmrc_,它的工作。

it work

@jhmsul
Copy link

jhmsul commented Nov 10, 2024

Basta apenas rodar o comando abaixo para desabilitar temporariamente o ipv6:

# desabilita temporariamente o ipv6 até uma próxima reinicialização do servidor:

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1

# Instale seu npm

# Habilita novamente o ipv6 caso não queira reiniciar o servidor:

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=0
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing perf For performance related issues Priority 2 secondary priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests