ionic cordova platform add android报错
ionic各种环境以及配置完但是添加平台报错:
Using cordova-fetch for anroid
Failed to fetch platform anroid
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
CordovaError: Error: npm: Command failed with exit code 1 Error output:
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/anroid - Not found
npm ERR! 404
npm ERR! 404 'anroid@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Sin\AppData\Roaming\npm-cache\_logs\2021-05-11T00_17_48_847Z-debug.log
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd platform add anroid exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
解决办法:
一、先查看一下有没有设置代理
npm config get proxy npm config get https-proxy
以上两个命令如果返回null,那么就不需要执行以下命令清理
npm config set https-proxy nullnpm config set proxy null
二、重新设置
npm config set registry https://registry.npmjs.org/
继续执行其他命令检测是否成功!