Capacitor: command not found: cap

Created on 16 Mar 2019  路  3Comments  路  Source: ionic-team/capacitor

Description of the problem:
I've tried to run npx cap init which failed due to missing node-gyp. I followed the installation instruction (windows-build-tools for node-gyp) but now when I try to run npx cap I get an error - "command not found: cap"

Affected platform
N/A

OS of the development machine
I'm using Windows 10 Version (10.0.17763 Build 17763)

Other information:
Tried using git bash / cmd

Capacitor version:
N/A

node version:
node 10.5

npm version:
npm 6.1

CocoaPods version:
N/A (cocopods is mac only?)

Steps to reproduce:

Link to sample project:

Most helpful comment

It does both things, install the library if needed or executes local executables, but in this case it鈥檚 required to be installed.
Notice that for create command, as it creates a new app, you use npx before installing the cli, but you use the library name instead of the executable name
npx @capacitor/cli create
That creates a new project and installs @capacitor/core and @capacitor/cli on it.

All 3 comments

Can you check if @capacitor/cli is installed on the project you are running the npx cap command?

I thought I did, seems to work now - though I was under the impression that npx installs library if needed? Anyhow thanks

It does both things, install the library if needed or executes local executables, but in this case it鈥檚 required to be installed.
Notice that for create command, as it creates a new app, you use npx before installing the cli, but you use the library name instead of the executable name
npx @capacitor/cli create
That creates a new project and installs @capacitor/core and @capacitor/cli on it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ebk46 picture ebk46  路  3Comments

nicobytes picture nicobytes  路  3Comments

alexcroox picture alexcroox  路  3Comments

danielsogl picture danielsogl  路  3Comments

MatanYadaev picture MatanYadaev  路  3Comments