Electron已经发布了6.0正式版,升级后发现原来能运行的代码报错提示require is not defined 解决办法: 修改创建BrowserWindow部分的相关代码,设置属性webPreferences.nodeIntegration为 true let win = new BrowserWindow({ webPreferences: { nodeIntegration: true } }) 在原有的new BrowserWindow基础上加入 webPreferences:…
今天安装markdown-pdf之后运行的时候报错: AssertionError: html-pdf: Failed to load PhantomJS module. You have to set the path to the PhantomJS binary using 'options.phantomPath' 之后安装brew install phantomjs,还是报相同的错误. 直接换markdown-themeable-pdf就可以正常生成pdf了. 环境是mac,windo…
wepy开发小程序使用getApp().globalData保存全局数据很方便,但是会在控制台看到很多报错:“error 'getApp' is not defined no-undef”,这是eslint报错. 解决办法:在.eslintrc.js文件中加入 globals: { getApp: true }…
前几天写了一个时间函数setInterval,然后出现了这个错误:Uncaught ReferenceError: dosave is not defined(…) 找了半天都没发现错在哪,最后找到解决方法,正确写法如下: js: 方法名 = function (){ alert("方法名在前"); } 下面这种写法有时候会出现错误: function dosave(){ alert("方法名在后"); }…
最近刚刚开始学习angular 4.0,在网上找了一个小项目教程学习,然而学习的过程有点艰辛,,各种报错,我明明就是按照博主的步骤老老实实走的呀!!话不多说,上bug- .- Uncaught Error: Unexpected value 'ProductComponent' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation. 刚刚报错的时候我一脸懵逼,什么意思呀?要…