簡體   English   中英

grunt-autoshot'無法調用方法'createPage'of undefined'

[英]grunt-autoshot 'cannot call method 'createPage' of undefined'

我想讓grunt-autoshot工作來截取我的項目的截圖,但似乎有一個我找不到的小故障 我已經以不同的方式重新配置了grunt.initConfig命令,似乎無法使其工作。 這是本地托管的,服務器正常加載,當打開grunt服務器時,我可以看到我的示例文件('index.html')。 以下是我現在使用的示例頁面

錯誤: '致命錯誤:無法調用'undefined'方法'createPage'

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

否則請訪問http://phantomjs.org/download.html

我和朋友一起工作,我們遇到了同樣的問題。

它看起來像是因為phantomjs的版本。 我使用的是1.9.2,我收到了同樣的錯誤,下載並安裝了1.9.0,它可以正常工作(它為我做了)你可以從這里下載: https//code.google.com/p/ phantomjs /下載/細節?命名= phantomjs-1.9.0-macosx.zip&可以= 1&q =

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM