node-addon-api cannot be located during npm install

Offen
#80 8 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
cpp, node.js
Bereich
build-system

Rechercherichtung

Reproduce the failure from the hello world example's node-addon-api directory with npm install and node -p "require('node-addon-api').include"; inspect the binding.gyp reference and compare it with the working napi directory. Done means the dependency resolves during installation and the example can build successfully.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

I am having a very strange bug. I am inside the node-addon-api dir of the hello world example and when I try to follow the instructions, I get a failure after command:
npm install

essentially it complains that it cannot find node-addon-api when the fline:
node -p "require('node-addon-api').include"
is executed to get the include dir for the binding.gyp file.

I am including the whole log for reference.

I have no idea why it's not able to find the module, sinc this error persists even when I insttall it directly:
npm install node-addon-api

I tried building the n-api dir and it worked no problem:
#inside napi dir
npm install
node-gyp rebuild
node ./
2019-01-12T19_08_43_417Z-debug.log

Vorherrschende Sprache
C++
Sterne
2.6k
Forks
602
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus nodejs/node-addon-examples

Alle Issues in nodejs/node-addon-examples

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.