Mohammed Rabiulla RABI
Mohammed Rabiulla RABI

Reputation: 493

Not able to integrate ionic with capacitor , npm throws error

I have a blank ionic project , I am trying to integrate with capacitor with ionic to build android app.

I run this command . ionic capacitor add android this throwing npm error please help me out to resolve this

C:\Users\i\Rabi\learn\ilearn>ionic capacitor add android

ionic integrations enable capacitor npm.cmd i --save -E @capacitor/core npm WARN @ionic/[email protected] requires a peer of @angular-devkit/architect@^0.1200.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself. npm WARN The package @angular/compiler is included as both a dev and production dependency. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\webpack-dev-server\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

130 packages are looking for funding run npm fund for details

found 3 moderate severity vulnerabilities run npm audit fix to fix them, or npm audit for details

npm.cmd i -D -E @capacitor/cli npm WARN @ionic/[email protected] requires a peer of @angular-devkit/architect@^0.1200.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself. npm WARN The package @angular/compiler is included as both a dev and production dependency. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\webpack-dev-server\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

129 packages are looking for funding run npm fund for details

found 3 moderate severity vulnerabilities run npm audit fix to fix them, or npm audit for details

capacitor.cmd init ilearn io.ionic.starter --npm-client npm error: unknown option '--npm-client' [ERROR] An error occurred while running subprocess capacitor.

    capacitor.cmd init ilearn io.ionic.starter --npm-client npm exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.

I tried npm audit fix but no success

Upvotes: 1

Views: 6061

Answers (2)

ZebraCoder
ZebraCoder

Reputation: 1700

Try this one

Open VS Code and type

1.ionic start

  • If it ask any question just put these(no,React,myApp,sidemenu,no)

2.cd myApp => ionic build

3.npm install @capacitor/android

4.npx cap add android

5.npx cap open android

Could not follow then watch this video Ionic Capacitor Tutorial - Ionic Build Android & Ionic Build iOS by Code Swag

Upvotes: 0

Tarun Kumar Pal
Tarun Kumar Pal

Reputation: 49

ionic capacitor add android is used to add "android" in the ionic project, not to integrate capacitor.

To integrate capacitor you need to do these steps

npm install @capacitor/core

npm install @capacitor/cli --save-dev

npx cap init

Upvotes: 4

Related Questions