无法通过npm全局安装Cordova与Ionic,求E404错误解决方法
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

