Nodegit和Electron没有合作
Nodegit and Electron not working together
我在nodegit中遇到了这个错误,我不确定是我不知道如何使用电子遥控器的错,还是nodegit有问题。我确实提出了一个问题以防万一。
在我的电子版main.js
文件中,我可以毫无问题地使用nodegit。
在网站上,我尝试将nodegit与remote
一起使用。我犯了一个错误。我的代码:
var remote = require('electron').remote;
var pathToRepo = remote.require('path').resolve(currentRepoDir);
remote.require('nodegit').Repository.open(pathToRepo).then(function(repo){
console.log(repo);
});
我得到错误:
Uncaught TypeError: require(...).remote.require(...).Repository.open is not a function
为什么open
不是函数?
为什么要使用remote.require
?
remote.require('path')
只需使用:
require('path')
require
在渲染过程中也起作用。
相关文章:
- 将Firebase与Electron结合使用
- 当脚本由system.js加载时,如何要求('electron')
- NEDB在Electron应用程序中的持久性
- Nodegit克隆不起作用
- 如何将eventListeners与Angularjs+Electron一起使用
- Electron:Express.js服务器在Mongo数据库'It’准备好了
- Electron的OAuth 2.0客户端机密
- 如何将信息从网络服务器发送到Electron应用程序
- Electron UI for Golang Program?
- 如何使用 electron-json-storage 将 json 发送回 angular
- Electron 和 Babel 6 异步/等待抛出意外令牌
- 如何在 Electron for OSX 中打包自定义图标
- 更新后,父视图未在 Electron 中的
上设置全局变量 - Atom Electron:在另一个窗口中渲染画布
- Electron从菜单栏打开新的全屏窗口
- 如何与Electron一起使用React路由器
- 用程序更改Electron中Web视图的内容
- Electron:将原始html注入BrowserWindow
- Electron和Typescript:如何在运行时正确处理模块
- Nodegit和Electron没有合作