npm install hangs on 'sill idealTree buildDeps' [Solved]

avatar
Borislav Hadzhiev

Last updated: Apr 4, 2024
4 min

banner

# npm install hangs on 'sill idealTree buildDeps' [Solved]

The issue where npm install hangs on 'sill idealTree buildDeps' occurs for multiple reasons:

  1. Not having the NPM registry configured correctly.
  2. A glitched node_modules directory or package-lock.json file.
  3. Caching issues.
  4. Using a VPN or having a very slow internet connection.
  5. Mixing NPM and YARN commands.

The first thing you should try is to set the NPM registry by issuing the following commands.

shell
npm cache clear --force npm config set registry http://registry.npmjs.org/

set correct registry npm

Try to rerun the npm install command after running the commands.

shell
npm install

NPM connects to a registry to resolve packages by name and version.

If your registry isn't set up correctly, the npm install command gets stuck with the 'sill idealTree buildDeps' message.

# Delete your node_modules and reinstall your dependencies

The issue also occurs if your node_modules folder and your package-lock.json or yarn.lock files are glitched.

If you are on Windows, use the following commands to delete the folder and the two files.

shell
# for Windows rd /s /q "node_modules" del package-lock.json del -f yarn.lock # 👇️ clean your npm cache npm cache clean --force npm install

If you are on macOS or Linux, issue the following commands instead.

shell
# for macOS or Linux rm -rf node_modules rm -f package-lock.json rm -f yarn.lock # 👇️ clean your npm cache npm cache clean --force npm install

If you use the integrated terminal in your IDE and the issue persists, restart your code editor.

# Try disabling the strict-ssl setting

If the issue persists, try to disable strict-ssl key validation.

shell
npm config set registry http://registry.npmjs.org/ npm config set strict-ssl false

npm disable strict ssl

Setting strict-ssl to false disables SSL validation when making requests to the NPM registry via HTTPS.

Try to issue the npm install command after making the change.

shell
npm install

If you want to enable strict-ssl, set it back to true.

shell
npm config set strict-ssl true

enable strict ssl validation

# Try to switch off your VPN and rerun npm install

Another cause of connectivity issues is using a VPN.

If you use a VPN, try to disable it and rerun the npm install command.

You can also try to restart your connection to the Wifi.

Reconnecting to the same network or using a different network often helps.

# Make sure to not mix NPM and YARN commands

The issue also occurs when you sometimes use NPM and sometimes use YARN.

Try to use the yarn install command if npm install gets stuck.

shell
yarn install

You can also delete your node_modules, package-lock.json and yarn.lock files and rerun the yarn install command.

You should either only use npm or only use yarn as mixing the two often causes issues.

# Solving the issue on macOS

If you are on macOS with an M1 chip:

  1. Go to System Settings.
  2. Click on Network in the sidebar.
  3. Click on Wifi.
  4. Click on the connected network and select details.
  5. Click on TCP/IP and select Change IPv6 from Automatically to Link-Local only.

If you are on macOS with an M2 chip:

  1. Go to System Settings.
  2. Click on Network in the sidebar.
  3. Click on Wifi.
  4. Click on the connected network and select details.
  5. Click on TCP/IP and select Configure IPv6 from Automatically to Link-Local Only.

After making the change, rerun the npm install command.

# Update your version of NPM

If the issue persists, try to update your version of npm if you are able to connect to the repository.

shell
npm install -g npm@latest

If you get a permissions error on Linux or macOS, rerun the command prefixed with sudo.

shell
sudo npm install -g npm@latest

If you get a permissions error on Windows, open CMD as an administrator and rerun the command.

To open CMD as an administrator:

  1. Click on the Search bar and type CMD.

  2. Right-click on the Command Prompt application and click "Run as administrator".

run cmd as administrator

  1. Rerun the command.
shell
npm install -g npm@latest

# Restart your code editor

If the issue persists, try to restart your code editor and rerun the npm install command.

This often helps, especially when using the integrated terminal in your IDE.

# Clear your NPM proxy

If the issue persists, try to clear your proxy settings in NPM by clicking on the link and following the instructions.

If you previously configured a proxy, it might be preventing you from reaching the NPM servers.

# Install the long-term supported version of Node.js

If the issue hasn't been resolved, try to install the long-term supported version of Node.js.

You could download the LTS version from the official nodejs.org website.

However, it is much more convenient to manage your npm version with the nvm package.

If you already have nvm installed, issue the following commands to install and switch to the LTS version.

shell
nvm install --lts nvm use --lts

nvm install and switch to lts

Want to learn more about installing and using NVM? Check out these resources: Install NVM on macOS and Linux,Install NVM on Windows.

If you don't have nvm installed, click on the link for your operating system, install NVM and switch to the LTS Node.js version.

Assuming you don't have any connectivity issues, you should be able to run the npm install command with the LTS version.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.