You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows11下安装Angular CLI遇ENOTFOUND错误,求解决方法

Fixing npm ENOTFOUND Error When Installing Angular CLI on Windows 11

Hey there, let's work through this npm registry resolution issue together—it's super common when dealing with network or proxy settings on Windows. Here are some practical steps to get your Angular CLI installed smoothly:

1. Clear Invalid Proxy Configurations

First, check if npm has leftover or incorrect proxy settings that might be blocking access:

  • Run these commands in Command Prompt or PowerShell to view current proxy configs:
    npm config get proxy
    npm config get https-proxy
    
  • If either returns a value (especially an unreachable proxy address), delete them with:
    npm config delete proxy
    npm config delete https-proxy
    

2. Switch to a Domestic npm Registry

The official npm registry might be slow or unreachable from your network. Try using a reliable domestic mirror like npmmirror (formerly Taobao):

  • Temporary fix (use only for this installation):
    npm install -g @angular/cli --registry=https://registry.npmmirror.com
    
  • Permanent fix (set as default for all future npm commands):
    npm config set registry https://registry.npmmirror.com
    
  • Verify the change with npm config get registry—it should return the mirror URL you set.

3. Fix DNS Resolution Issues

The error indicates npm can't resolve registry.npmjs.org, which points to a DNS problem. Try these steps:

  • First, run ping registry.npmjs.org in Command Prompt. If it fails to resolve the address, switch your DNS server:
    1. Go to Settings > Network & Internet > Advanced network settings > More network adapter options
    2. Right-click your active network connection and select Properties
    3. Find Internet Protocol Version 4 (TCP/IPv4), double-click it
    4. Select Use the following DNS server addresses and enter:
      • Preferred DNS server: 8.8.8.8 (Google DNS) or 114.114.114.114 (domestic public DNS)
      • Alternate DNS server: 8.8.4.4 or 114.114.115.115
    5. Save changes and flush your DNS cache with ipconfig /flushdns

4. Reset Windows Network Stack

Corrupted network settings can cause unexpected connection issues. Reset them with these admin-level commands:

  1. Open Command Prompt as Administrator
  2. Run these commands one by one:
    ipconfig /flushdns
    netsh winsock reset
    netsh int ip reset
    
  3. Restart your computer and try installing Angular CLI again.

5. Check Firewall/Antivirus Interference

Sometimes Windows Defender or third-party antivirus software blocks npm's network requests:

  • Temporarily disable your firewall/antivirus, then run npm install -g @angular/cli again.
  • If the installation succeeds, add npm.exe (usually located in C:\Program Files\nodejs\) to your firewall's allowed apps list to avoid future blocks.

6. Reinstall Node.js (Last Resort)

If all other steps fail, a clean Node.js install might fix hidden configuration glitches:

  • Uninstall Node.js from Settings > Apps > Installed apps
  • Download the Node.js 18.13.0 installer (match your PC's architecture)
  • Run the installer with default settings, then try installing Angular CLI once more.

内容的提问来源于stack exchange,提问作者fatiha chaibi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 10:01:45