2017-10-07 21 views
0

저는 webpack을 사용하여 구축중인 오픈 소스 전자 프로젝트에서 일하고 있습니다. 내 프로젝트의 요구 사항 중 하나는 기본 모듈로 빌드해야하는 nodegit 라이브러리를 사용하는 것입니다.전자 프로젝트에서 native nodejs 모듈을 가져올 수 없습니다.

네이티브 모듈과 전자로 작업 할 때 일반적인 조언 인 것처럼 보였습니다. 즉, 인 경우 .node 파일을 가져 오려면 configured the source package to use이고 마지막으로 have configured node-loader이 있어야합니다.

내가 모듈을 포함하는 갈 때

불행하게도, 나는이 오류와 끝까지 :

ERROR in ./node_modules/nodegit/dist/nodegit.js 
Module not found: Error: Can't resolve '../build/Debug/nodegit.node' in 
'C:\Users\atrauzzi\Development\atrauzzi\gerty\node_modules\nodegit\dist' 
    @ ./node_modules/nodegit/dist/nodegit.js 18:11-49 
    @ ./src/Layer/Domain/Thunktor/Git/CloneGitRepository.ts 
    @ ./src/Layer/Gerty/Component/Repository/AddGitHubRepository.tsx 
    @ ./src/Layer/Gerty/Component/Repository/AddRepository.tsx 
    @ ./src/Layer/Gerty/Component/Workspace.tsx 
    @ ./src/Layer/Gerty/Component/App.tsx 
    @ ./src/Layer/Gerty/GertyServiceProvider.ts 
    @ ./src/Bundle/GertyElectron.ts 

내가 그이 시점에서 의심의 볼 수있는 유일한 방법은 그 나는 전자와 함께 작업 할 수있는 모듈을 다시 할 때 가져 오기가 Debug을 찾고있는 것 같다 때, 나는 단지하는 Release 디렉토리를 얻을 :

enter image description here

이 붉은 청어 그러나 as nodegit is written to try Debug as a fallback after Release has failed 수 있습니다.

일반적인 질문은 "이 기본 모듈을 내 프로젝트에서 어떻게 작동 시키나요?"입니다.

나는 또한 내 문제가 도서관 자체와 관련이 없거나 전자에 내재 된 모듈의 일부 전투 착용 베테랑이 있음에도 불구하고 확인할 수있는 좋은 장소라고 생각했지만 corresponding question over at the repo을 가지고 있습니다. 게다가.

답변