首页 > Web开发 > 详细

electron "Cannot find module 'dialog'", source: module.js (336)"

时间:2015-10-07 06:17:57      阅读:738      评论:0      收藏:0      [点我收藏+]

打算用electron的dialog api

谁知道, 按官方api

http://electron.atom.io/docs/v0.33.0/api/dialog/

https://github.com/atom/electron/blob/master/docs/api/remote.md

竟然报 Cannot find module ‘dialog‘

我一开始以为这是nodejs的模块(刚用node,不熟悉),然后就安装

npm install dialog

结果发现这个dialog跟官方文档中说的dialog不是一个,因为方法对不上

于是

npm uninstall dialog

然后再搜素搜索发现

要用remote模块

于是

这样就可以了

var remote = require(‘remote‘);
var dialog = remote.require(‘dialog‘);

  

electron "Cannot find module 'dialog'", source: module.js (336)"

原文:http://www.cnblogs.com/simoncook/p/4858163.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!