Last updated: Apr 4, 2024
Reading time·4 min
The issue where npm install
hangs on 'sill idealTree buildDeps' occurs for
multiple reasons:
node_modules
directory or package-lock.json
file.The first thing you should try is to set the NPM registry by issuing the following commands.
npm cache clear --force npm config set registry http://registry.npmjs.org/
Try to rerun the npm install
command after running the commands.
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.
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.
# 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.
# 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.
strict-ssl
settingIf the issue persists, try to disable strict-ssl key validation.
npm config set registry http://registry.npmjs.org/ npm config set strict-ssl false
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.
npm install
If you want to enable strict-ssl
, set it back to true
.
npm config set strict-ssl true
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.
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.
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.
If you are on macOS with an M1
chip:
If you are on macOS with an M2
chip:
After making the change, rerun the npm install
command.
If the issue persists, try to update your version of npm
if you are able to
connect to the repository.
npm install -g npm@latest
If you get a permissions error on Linux or macOS, rerun the command prefixed
with sudo
.
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:
Click on the Search bar and type CMD.
Right-click on the Command Prompt application and click "Run as administrator".
npm install -g npm@latest
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.
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.
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.
nvm install --lts nvm use --lts
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.
You can learn more about the related topics by checking out the following tutorials: