question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npx cap init fails: compilation terminated

See original GitHub issue

Description 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:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
Eruditioncommented, Mar 13, 2019

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!

3reactions
Eruditioncommented, Mar 13, 2019

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 to command not found: cap instead, with a bunch of casting warnings.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found