Cannot build apk

When I try to with “ionic cordova build android”.
With cmd, running long long time …

With powershell, it displaying this:

try to create a brand new project and transplant your src folder, re-install plugins, npm packages.
Then build your apk again.

Hundreds of errors. Tried to reinstall node and everything (multiple times). No luck.
Is there a confirm way to reinstall all these, without reinstalling Windows?

Try ones to remove and add platfrom

Reinstalled Windows 8.1
Build command still not working (on newly created projects, with blank or tabs template)

D:\m1\t1>ionic cordova build android
Running app-scripts build: --platform android --target cordova
[16:30:33]  build dev started ...
[16:30:33]  clean started ...
[16:30:33]  clean finished in less than 1 ms
[16:30:33]  copy started ...
[16:30:33]  deeplinks started ...
[16:30:33]  deeplinks finished in less than 1 ms
[16:30:33]  transpile started ...
[16:30:35]  transpile finished in 2.45 s
[16:30:35]  preprocess started ...
[16:30:35]  preprocess finished in less than 1 ms
[16:30:35]  webpack started ...
[16:30:36]  copy finished in 2.59 s
[16:30:40]  webpack finished in 4.41 s
[16:30:40]  sass started ...
Without `from` option PostCSS could generate wrong source map and will not find
Browserslist config. Set it to CSS file path or to `undefined` to prevent this w
[16:30:41]  sass finished in 750 ms
[16:30:41]  postprocess started ...
[16:30:41]  postprocess finished in less than 1 ms
[16:30:41]  lint started ...
[16:30:41]  build dev finished in 7.72 s
> cordova build android

You have been opted out of telemetry. To change this, run: cordova telemetry on.

Android Studio project detected

(node:1088) UnhandledPromiseRejectionWarning: CordovaError: Failed to find 'ANDR
OID_HOME' environment variable. Try setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to inclu
de path to valid SDK directory.
    at D:\m1\t1\platforms\android\cordova\lib\check_reqs.js:305:19
    at _fulfilled (D:\m1\t1\platforms\android\cordova\node_modules\q\q.js:854:54
    at self.promiseDispatch.done (D:\m1\t1\platforms\android\cordova\node_module
    at Promise.promise.promiseDispatch (D:\m1\t1\platforms\android\cordova\node_
    at D:\m1\t1\platforms\android\cordova\node_modules\q\q.js:877:14
    at runSingle (D:\m1\t1\platforms\android\cordova\node_modules\q\q.js:137:13)

    at flush (D:\m1\t1\platforms\android\cordova\node_modules\q\q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
(node:1088) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). (rejection
 id: 1)
(node:1088) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
 Node.js process with a non-zero exit code.
[16:30:42]  lint finished in 1.89 s