我想得到 grunt-autoshot正在努力截取我的项目的屏幕截图,但似乎有一个我找不到的小问题。 我用不同的方式重新配置了 grunt.initConfig 命令,但似乎无法正常工作。这都是本地托管的,服务器正在正确加载,我可以在 grunt server 时看到我的示例文件('index.html')已打开。以下是我现在使用的基于 example page 的内容
Error: 'Fatal error: Cannot call method 'createPage' of undefined'
autoshot: {
default_options: {
options: {
// necessary config
path: 'screenshots/',
local: {
path: './test',
port: 9000,
files: [{
src: 'index.html',
dest: 'index.jpg'
}]
},
viewport: [
'320x480', '480x320', '384x640', '640x384', '602x963', '963x602', '600x960', '960x600', '800x1280', '1280x800', '768x1024', '1024x768'
]
},
},
},
最佳答案
您需要安装 PhantomJS。
如果您使用的是 Mac,您可以:
brew update && brew install phantomjs
关于javascript - grunt-autoshot 'cannot call method ' createPage' of undefined',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19298207/