Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Interface 'PHPParser_NodeVisitor' not found #20

Closed
wxs77577 opened this issue Aug 21, 2015 · 11 comments
Closed

Error: Interface 'PHPParser_NodeVisitor' not found #20

wxs77577 opened this issue Aug 21, 2015 · 11 comments

Comments

@wxs77577
Copy link

$ vendor/bin/apidoc api vendor/yiisoft/yii2 out
Searching files to process... done.
Loading apidoc data from cache... no data available.
Checking for updated files... done.
331 files to update.
Processing files... 0% (0/331) ETA: n/a   PHP Fatal error:  Interface 'PHPParser_NodeVisitor' not found in /Library/WebServer/Documents/yii2doc/vendor/phpdocumentor/reflection/src/phpDocumentor/Reflection/FileReflector.php on line 51
Error: Interface 'PHPParser_NodeVisitor' not found
@cebe
Copy link
Member

cebe commented Aug 21, 2015

can you give me the output of composer show -i? it should list all the versions of packages you have installed.

@wxs77577
Copy link
Author

$ composer show -i
bower-asset/bootstrap             v3.3.5             The most popular front-end framework for developing responsive, mobile fi...
bower-asset/jquery                2.1.4              
bower-asset/jquery.inputmask      3.1.63             jquery.inputmask is a jquery plugin which create an input mask.
bower-asset/punycode              v1.3.2             
bower-asset/yii2-pjax             dev-master 3f20897 
cebe/js-search                    dev-master ca1a1d0 A client side search engine for use on static pages.
cebe/markdown                     1.0.x-dev f681fee  A super fast, highly extensible markdown parser for PHP
cebe/markdown-latex               dev-master 0018223 A super fast highly extensible markdown parser for PHP that converts mark...
ezyang/htmlpurifier               v4.6.0             Standards compliant HTML filter written in PHP
mikevanriel/text-to-latex         1.0.0              A converter class that converts normal ASCII text to valid LaTeX
phpdocumentor/reflection          dev-master fc40c3f Reflection library to do Static Analysis for PHP Projects
phpdocumentor/reflection-docblock 2.0.4              
psr/log                           dev-master 9e45edc Common interface for logging libraries
yiisoft/yii2                      dev-master baed9ab Yii PHP Framework Version 2
yiisoft/yii2-apidoc               dev-master eee2700 API Documentation generator for the Yii framework 2.0

@cebe
Copy link
Member

cebe commented Aug 21, 2015

how did you manage to install yiisoft/yii2-apidoc without installing nikic/php-parser which is required by it: https://github.com/yiisoft/yii2-apidoc/blob/master/composer.json#L26 ?

@cebe
Copy link
Member

cebe commented Aug 21, 2015

can you also show your composer.json?

@wxs77577
Copy link
Author

$cat composer.json
{
    "name": "root/yii2doc",
    "require": {
        "yiisoft/yii2-apidoc": "^2.0@dev"
    },
    "authors": [
        {
            "name": "xuesong",
            "email": "wu-xuesong@qq.com"
        }
    ],
    "minimum-stability": "dev"
}

@cebe
Copy link
Member

cebe commented Aug 22, 2015

Unable to reproduce the issue. With your composer.json I get the following packages installed:

$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing yiisoft/yii2-composer (dev-master 6b2a2b3)  
    Cloning 6b2a2b3bb83d4b3dd791f76e64c48973ce01bac6

  - Installing cebe/markdown (1.0.x-dev f681fee)
    Cloning f681fee8303310415b746f3758eeda0a7ad08bda

  - Installing bower-asset/jquery (2.1.4)
    Loading from cache

  - Installing bower-asset/yii2-pjax (dev-master 3f20897)
    Cloning 3f20897307cca046fca5323b318475ae9dac0ca0

  - Installing bower-asset/punycode (v1.3.2)
    Loading from cache

  - Installing bower-asset/jquery.inputmask (3.1.63)
    Loading from cache

  - Installing ezyang/htmlpurifier (v4.6.0)
    Loading from cache

  - Installing yiisoft/yii2 (dev-master 76500e2)
    Cloning 76500e2fe71c2ff4a4ec2195e1f18cb605140866

  - Installing bower-asset/bootstrap (v3.3.5)
    Loading from cache

  - Installing yiisoft/yii2-bootstrap (dev-master 51ed559)
    Cloning 51ed559fe2ef9d33217e47a0ac77ffaa15f57c30

  - Installing mikevanriel/text-to-latex (1.0.0)
    Loading from cache

  - Installing cebe/markdown-latex (dev-master 0018223)
    Cloning 001822396bb6990de5d0d13f6cc42d08c94b4afe

  - Installing cebe/js-search (dev-master ca1a1d0)
    Cloning ca1a1d09e8d922a8f25f9bf2c1192041a1ee9d24

  - Installing phpdocumentor/reflection-docblock (2.0.4)
    Loading from cache

  - Installing nikic/php-parser (0.9.x-dev ef70767)
    Cloning ef70767475434bdb3615b43c327e2cae17ef12eb

  - Installing psr/log (dev-master 9e45edc)
    Cloning 9e45edca52cc9c954680072c93e621f8b71fab26

  - Installing phpdocumentor/reflection (dev-master fc40c3f)
    Cloning fc40c3f604ac2287eb5c314174d5109b2c699372

  - Installing yiisoft/yii2-apidoc (dev-master eee2700)
    Cloning eee2700df2c1c6120781999e722a4a0698fc1e3d

phpdocumentor/reflection-docblock suggests installing dflydev/markdown (~1.0)
phpdocumentor/reflection-docblock suggests installing erusev/parsedown (~1.0)
Writing lock file
Generating autoload files
$ composer show -i
bower-asset/bootstrap             v3.3.5             The most popular front-end framework for developing responsive, mobile first projects on the web.
bower-asset/jquery                2.1.4              
bower-asset/jquery.inputmask      3.1.63             jquery.inputmask is a jquery plugin which create an input mask.
bower-asset/punycode              v1.3.2             
bower-asset/yii2-pjax             dev-master 3f20897 
cebe/js-search                    dev-master ca1a1d0 A client side search engine for use on static pages.
cebe/markdown                     1.0.x-dev f681fee  A super fast, highly extensible markdown parser for PHP
cebe/markdown-latex               dev-master 0018223 A super fast highly extensible markdown parser for PHP that converts markdown files into latex
ezyang/htmlpurifier               v4.6.0             Standards compliant HTML filter written in PHP
mikevanriel/text-to-latex         1.0.0              A converter class that converts normal ASCII text to valid LaTeX
nikic/php-parser                  0.9.x-dev ef70767  A PHP parser written in PHP
phpdocumentor/reflection          dev-master fc40c3f Reflection library to do Static Analysis for PHP Projects
phpdocumentor/reflection-docblock 2.0.4              
psr/log                           dev-master 9e45edc Common interface for logging libraries
yiisoft/yii2                      dev-master 76500e2 Yii PHP Framework Version 2
yiisoft/yii2-apidoc               dev-master eee2700 API Documentation generator for the Yii framework 2.0
yiisoft/yii2-bootstrap            dev-master 51ed559 The Twitter Bootstrap extension for the Yii framework
yiisoft/yii2-composer             dev-master 6b2a2b3 The composer plugin for Yii extension installer

you could try to run composer udpate and see if missing packages are installed.

@johnitvn
Copy link

johnitvn commented Sep 7, 2015

I have the same issue

[root@phim365:/var/www/ems.dev ]$ composer show -i
bower-asset/animate.css             dev-master d8144b9
bower-asset/bootstrap               v3.3.5              The most popular front-end framework for developing responsive, mobile first projects on the web.
bower-asset/bootstrap-datepicker    v1.4.0
bower-asset/chosen                  v1.4.2              Chosen is a JavaScript plugin that makes long, unwieldy select boxes much more user-friendly. It is currently available in both jQuery and Prototype flavors.
bower-asset/cropper                 v0.11.1             A simple jQuery image cropping plugin.
bower-asset/font-awesome            dev-master 577e1b2  Font Awesome
bower-asset/icheck                  1.0.2               Highly customizable checkboxes and radio buttons (jQuery & Zepto)
bower-asset/jquery                  2.1.4
bower-asset/jquery-ui               1.11.4
bower-asset/jquery.inputmask        3.1.63              jquery.inputmask is a jquery plugin which create an input mask.
bower-asset/metisMenu               v2.1.0              A jQuery menu plugin
bower-asset/pace                    v1.0.2              Automatic page load progress bar
bower-asset/punycode                v1.3.2
bower-asset/slimscroll              v1.3.6              slimScroll is a small jQuery plugin that transforms any div into a scrollable area. slimScroll doesn't occupy any visual space as it only appears on a user initiated mouse-over.
bower-asset/sweetalert              v1.1.0              A beautiful replacement for JavaScript's alert.
bower-asset/toastr                  2.1.1
bower-asset/typeahead.js            v0.11.1
bower-asset/yii2-pjax               dev-master 3f20897
cebe/markdown                       dev-master e14d3da  A super fast, highly extensible markdown parser for PHP
codeception/specify                 dev-master bf7b985  BDD code blocks for PHPUnit and Codeception
codeception/verify                  dev-master 7c60fb5  BDD assertion library for PHPUnit
dmstr/yii2-migrate-command          dev-master 308e414  Console Migration Command with multiple paths/aliases support
ezyang/htmlpurifier                 v4.6.0              Standards compliant HTML filter written in PHP
facebook/php-sdk-v4                 dev-master 56dfa77  Facebook SDK for PHP
fzaninotto/faker                    dev-master 7f842c2  Faker is a PHP library that generates fake data for you.
kartik-v/bootstrap-fileinput        dev-master d0b583f  An enhanced HTML 5 file input for Bootstrap 3.x with features for file preview for many file types, multiple selection, ajax uploads, and more.
kartik-v/bootstrap-star-rating      dev-master 8d14b53  A simple yet powerful JQuery star rating plugin for Bootstrap.
kartik-v/dependent-dropdown         dev-master 03b086d  A multi level dependent dropdown JQuery plugin that allows nested dependencies.
kartik-v/yii2-krajee-base           dev-master c0adff9  Base library and foundation components for all Yii2 Krajee extensions.
kartik-v/yii2-widget-activeform     v1.4.2              Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).
kartik-v/yii2-widget-affix          dev-master 4e4c88a  A scrollspy and affixed enhanced navigation to highlight page sections (sub repo split from yii2-widgets)
kartik-v/yii2-widget-alert          dev-master 5706274  A widget to generate alert based notifications using bootstrap-alert plugin (sub repo split from yii2-widgets)
kartik-v/yii2-widget-colorinput     dev-master 907fd10  An enhanced Yii 2 widget encapsulating the HTML 5 color input (sub repo split from yii2-widgets)
kartik-v/yii2-widget-datepicker     v1.3.2              Enhanced Yii2 wrapper for the bootstrap datepicker plugin (sub repo split from yii2-widgets).
kartik-v/yii2-widget-datetimepicker dev-master 6fff3db  Enhanced Yii2 wrapper for the bootstrap datetimepicker plugin (sub repo split from yii2-widgets)
kartik-v/yii2-widget-depdrop        v1.0.1              Widget that enables setting up dependent dropdowns with nested dependencies (sub repo split from yii2-widgets)
kartik-v/yii2-widget-fileinput      v1.0.2              An enhanced FileInput widget for Bootstrap 3.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)
kartik-v/yii2-widget-growl          dev-master c79abaa  A widget to generate growl based notifications using bootstrap-growl plugin (sub repo split from yii2-widgets)
kartik-v/yii2-widget-rangeinput     dev-master 38dd7c6  An enhanced Yii 2 widget encapsulating the HTML 5 range input (sub repo split from yii2-widgets)
kartik-v/yii2-widget-rating         dev-master 8cef838  A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)
kartik-v/yii2-widget-select2        v2.0.0              Enhanced Yii2 wrapper for the Select2 jQuery plugin (sub repo split from yii2-widgets).
kartik-v/yii2-widget-sidenav        dev-master 54186e7  An enhanced side navigation menu styled for bootstrap (sub repo split from yii2-widgets)
kartik-v/yii2-widget-spinner        1.0.0.x-dev 3132ba1 A widget to render animated CSS3 loading spinners with VML fallback for IE (sub repo split from yii2-widgets)
kartik-v/yii2-widget-switchinput    dev-master c3bc211  A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes & radios as toggle switchinputes (sub repo split from yii2-widgets)
kartik-v/yii2-widget-timepicker     dev-master b6538d1  Enhanced Yii2 wrapper for the bootstrap timepicker plugin (sub repo split from yii2-widgets)
kartik-v/yii2-widget-touchspin      dev-master f41a1fe  A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes & radios as toggle touchspines (sub repo split from yii2-widgets)
kartik-v/yii2-widget-typeahead      1.0.0.x-dev 96be042 Enhanced Yii2 wrapper for the Twitter Typeahead plugin (sub repo split from yii2-widgets).
kartik-v/yii2-widgets               dev-master b7eb849  Collection of useful widgets for Yii Framework 2.0 extending functionalities for Bootstrap
myclabs/deep-copy                   1.3.1               Create deep copies (clones) of your objects
nikic/php-parser                    0.9.x-dev ef70767   A PHP parser written in PHP
pdepend/pdepend                     2.1.0               Official version of pdepend to be handled with Composer
phpdocumentor/reflection            dev-master fc40c3f  Reflection library to do Static Analysis for PHP Projects
phpdocumentor/reflection-docblock   2.0.4
phpmd/phpmd                         2.2.3               PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.
phpspec/php-diff                    dev-master 30e103d  A comprehensive library for generating differences between two hashable objects (strings or arrays).
psr/log                             dev-master 9e45edc  Common interface for logging libraries
slim/slim                           2.x-dev faf8306     Slim Framework, a PHP micro framework
slim/views                          0.1.3               Smarty and Twig View Parser package for the Slim Framework
squizlabs/php_codesniffer           2.3.3               PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.
swiftmailer/swiftmailer             5.x-dev 6522539     Swiftmailer, free feature-rich PHP mailer
symfony/config                      dev-master a128eea  Symfony Config Component
symfony/dependency-injection        dev-master c71a6ce  Symfony DependencyInjection Component
symfony/filesystem                  dev-master 00e0462  Symfony Filesystem Component
symfony/yaml                        2.5.x-dev 6eb40ab   Symfony Yaml Component
twig/twig                           1.x-dev 825bdc1     Twig, the flexible, fast, and secure template language for PHP
yiisoft/yii2                        dev-master cedf322  Yii PHP Framework Version 2
yiisoft/yii2-apidoc                 2.0.0-beta          API Documentation generator for the Yii framework 2.0
yiisoft/yii2-bootstrap              dev-master 5ae1277  The Twitter Bootstrap extension for the Yii framework
yiisoft/yii2-codeception            dev-master 4428504  The Codeception integration for the Yii framework
yiisoft/yii2-composer               dev-master 6b2a2b3  The composer plugin for Yii extension installer
yiisoft/yii2-debug                  dev-master daf79cf  The debugger extension for the Yii framework
yiisoft/yii2-faker                  dev-master 091bc3c  Fixture generator. The Faker integration for the Yii framework.
yiisoft/yii2-gii                    dev-master 6519954  The Gii extension for the Yii framework
yiisoft/yii2-jui                    dev-master 7b71a03  The Jquery UI extension for the Yii framework
yiisoft/yii2-swiftmailer            dev-master fffcd50  The SwiftMailer integration for the Yii framework
[root@phim365:/var/www/ems.dev ]$ ./bin/genapi
Searching files to process... done.
Loading apidoc data from cache... no data available.
Checking for updated files... done.
16 files to update.
Processing files... 0% (0/16) ETA: n/a   PHP Fatal error:  Interface 'PHPParser_NodeVisitor' not found in /var/www/ems.dev/vendor/phpdocumentor/reflection/src/phpDocumentor/Reflection/FileReflector.php on line 51
Error: Interface 'PHPParser_NodeVisitor' not found

@wxs77577
Copy link
Author

wxs77577 commented Sep 7, 2015

I have resolved this problem.just because of the network reason.try composer install again(and again...)

@johnitvn
Copy link

johnitvn commented Sep 8, 2015

@genyii Network problem? You mean composer have been install not correct version of depend packages, right?

@wxs77577
Copy link
Author

wxs77577 commented Sep 8, 2015

right.I had run "composer install" again and again

@johnitvn
Copy link

johnitvn commented Sep 8, 2015

@genyii Ok. Thanks for quick response

justinyost added a commit to loadsys/CakePHP-Shell-Scripts that referenced this issue Apr 7, 2016
Fixes bug with PHP Documentor with newer versions of PHP Parser, per bug reports phpDocumentor/phpDocumentor#1743 and yiisoft/yii2-apidoc#20

Signed-off-by: Justin Yost <justin@loadsys.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants