Installing/Using Phantom.js with Meteor

前端 未结 2 722
傲寒
傲寒 2020-12-17 07:23

I\'m currently struggling with using Phantom.js with a Meteor app of mine. I have it installed on my local machine (Ubuntu 14.04), it\'s added to my path (I can run it from

2条回答
  •  情话喂你
    2020-12-17 07:52

    The phantomjs wrapper in atmosphere doesn't look like it produces anything that works.

    But you can easily add npm packages useing the npm meteorite package

    First add the npm package to your project

    mrt add npm
    

    Then add the required phantomjs version to the packages.json file

    {
         "phantomjs": "1.9.7-6"
    }
    

    Then use the following code to require the phantomjs npm module:

    var phantomjs = Meteor.require('phantomjs');
    

提交回复
热议问题