phantomjs: command not found

后端 未结 5 1976
长发绾君心
长发绾君心 2020-12-08 00:36

I followed these instructions (except for copying the executable to my PATH because I cannot seem to find it and it does not seem necessary). Then I made a file called image

5条回答
  •  盖世英雄少女心
    2020-12-08 01:17

    Mac PATH suggested setup:

    1. Open Terminal.
    2. Type vi ~/.bash_profile and hit enter (this opens or creates your bash_profile where you can customize Terminal commands).
    3. Press i to enter insert/edit mode then type alias phantomjs='~/PATH/TO/phantomjs' and be sure to replace ~/PATH/TO/phantomjs with something like ~/Documents/PhantomJS/bin/phantomsj or wherever the file exists on your machine.
    4. Press esc to exit insert/edit mode then type :x and hit enter to save the file.
    5. Quit and re-open Terminal.
    6. Type phantomjs and hit enter. If you see the prompt phantomjs> then you're all set.
    7. Type phantom.exit() to end the PhantomJS program.
    8. Now you can navigate to any folder and run PhantomJS by simply typing phantomjs. This is helpful when saving screenshots because the images will be saved inside the folder that's active in your Terminal.

提交回复
热议问题