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

无法通过npm全局安装Cordova与Ionic,求E404错误解决方法

Fixing the pinkie-promise@^2.0.0 404 Not Found Error When Installing Cordova & Ionic Globally

Hey there, I’ve dealt with this exact error before when setting up Cordova and Ionic, so let me share the solutions that got me past it:

Step 1: Clear the NPM Cache

Corrupted or outdated cache is a common culprit here. Force-clear it with:

npm cache clean --force

This removes any stale package data that might be causing the 404 error.

Step 2: Switch to the Official NPM Registry

If you’re using a third-party registry (like a regional mirror), it might not have synced the pinkie-promise version yet. Switch back to the official registry:

npm config set registry https://registry.npmjs.org/

Step 3: Install pinkie-promise Separately First

Sometimes installing the problematic package alone resolves the issue, then you can install Cordova and Ionic:

npm install -g pinkie-promise@^2.0.0
npm install -g cordova ionic

Step 4: Upgrade Your NPM Version

Older NPM versions can have bugs with package resolution. Upgrade to the latest version:

npm install -g npm@latest

Step 5: Check for Proxy/Firewall Issues

If you’re behind a proxy or firewall, it might be blocking access to the NPM registry. Check your proxy settings:

npm config get proxy
npm config get https-proxy

If you don’t need a proxy, clear these settings:

npm config delete proxy
npm config delete https-proxy

Give these steps a try in order—most people fix the issue with the first two steps!

内容的提问来源于stack exchange,提问作者Kusal Kithmal

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.15 07:33:29