Answer the question
In order to leave comments, you need to log in
Why do NPM packages take a long time to install, if not at all?
The essence of the problem is that npm packages are not installed for a long time or even at all, and the node_modules folder does not appear. I tried reinitialization and updated the json file, and just separately tried to install some module, the problem is the same on both Windows and Linux. Node v5.8.0 npm v3.7.3
Who can tell what it is and how to solve this problem, thanks in advance.
Answer the question
In order to leave comments, you need to log in
This problem occurs in many versions of npm and NodeJS, and, as far as I understand, in some cases it may still be relevant, so I decided to answer the question now.
As far as I understood from googling, if we exclude the most obvious problem (“you have problems with the Internet”), then there can be many reasons for this behavior. I will tell you how I ended up in a similar situation and what I did to solve the problem, maybe it will be useful to someone.
In my case, an annoying bug with Babel aliases once appeared, which eventually required updating it, and after updating Babel, the project simply stopped building. I had to update Node, then npm, etc. As a result, the project was still assembled, but there was a problem voiced in the question - npm ci (this is almost the same asnpm install , only installs strictly those versions that are specified in package-lock) began to work very slowly, hanging for a long time on various random packages.
I assumed that there could be two reasons for this situation in the end:
# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
apt-get install -y nodejs
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question