Ubuntu下创建Cordova应用失败:获取3.6.3版本资源报HTTP 404错误
Hey there, I’ve dealt with this exact issue before when working with older Cordova versions—those legacy resource paths can get moved or removed over time. Let’s walk through the most reliable fixes:
1. Upgrade Cordova to a newer (but compatible) stable version
Older Cordova releases like 4.3.1 rely on outdated resource packages that may no longer be hosted. Upgrading to a slightly newer, stable version that still supports your use case should resolve the 404. Try installing version 5.1.1 (a solid middle ground between 4.x and newer releases):
npm install -g cordova@5.1.1
Once installed, re-run your cordova create command—it should pull the correct, available www resources this time.
2. Manually specify a valid cordova-www version
If you can’t upgrade Cordova, you can directly tell it to use an existing version of the cordova-www package. First, check which versions are still available on npm:
npm view cordova-www versions
Pick a version compatible with Cordova 4.3.1 (I’d recommend 3.7.0, which was a common replacement for 3.6.3). Then create your project with the --lib flag:
cordova create hello com.example.hello HelloWorld --lib cordova-www@3.7.0
3. Clear npm cache and try again
Sometimes a corrupted local cache can cause unexpected download errors. Clear it with:
npm cache clean --force
After clearing, re-run your original cordova create command. If the 404 persists, combine this with the manual version method above.
Why this happens
Cordova 4.3.1 is configured by default to pull version 3.6.3 of the cordova-www package during project creation. Over time, older package versions often get archived or removed from public npm repositories, leading to the 404 error you’re seeing.
内容的提问来源于stack exchange,提问作者Saeid Khorsand

