npx cap init fails: compilation terminated
See original GitHub issueDescription of the problem: Following the getting started guide I did this:
mkdir capacitor cd capacitor npm install --save @capacitor/core @capacitor/cli npx cap init
The result:
../src/binding.cc:4:23: fatal error: pcap/pcap.h: No such file or directory
#include <pcap/pcap.h>
^
compilation terminated.
make: *** [Release/obj.target/cap/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.7.0-0.bpo.1-amd64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/auke/.npm/_npx/19093/lib/node_modules/cap
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cap@0.2.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cap@0.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
OS of the development machine
- linux
node version: v8.9.4
npm version: 5.6.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to overcome Capacitor Initialize error in angular 13.x
$ npx cap init [error] Non-interactive shell detected. Run the command with --help to see a list of arguments that must be provided....
Read more >Troubleshooting - SAP Capire
The name/prefix of the native SAP HANA object collides with a name/prefix in the CAP CDS model. Solution, Change the name of the...
Read more >Building a Native Mobile App with Next.js and Capacitor
npm run static npx cap sync. The first command will simply build your Next.js project and export the static build, while the second...
Read more >srun - Slurm Workload Manager - SchedMD
Once a job dependency fails due to the termination state of a preceding job, the dependent job will never be run, even if...
Read more >Gonna Need A Bigger Boat! | Fails of the Week - YouTube
No boat is too small for failing. ▻▻▻ SUBMIT YOUR VIDEOS! http://bit.ly/fasubmit SUBSCRIBE! http://bit.ly/fasubscribeCheck out FailArmy ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Phew!
Tried a ton of things, the one that finally got npx to “see it” was using this:
npx @capacitor/cli init
Hope that helps others!
I have the same issue. npm -v: 6.9.0 node -v: v10.15.0
In my case,
sudo apt-get install libpcap-dev
seemed to fix that particular problem. That got me tocommand not found: cap
instead, with a bunch of casting warnings.