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

docusaurus-init fails in Hack/PHP projects: Error: ENOTDIR: not a directory, scandir '.../vendor/bin/hh-autoload' #790

Closed
fredemmott opened this issue Jun 20, 2018 · 5 comments
Assignees
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@fredemmott
Copy link

Is this a bug report?

(write your answer here)
Yes

Have you read the [Contributing Guidelines on issues]

Yes

Environment

Docusaurus was just installed via yarn global add docusaurus. Yarn outdated command fails:

error An unexpected error occurred: "No lockfile in this directory. Run `yarn install` to generate one.".

Probably because this isn't a JS project.

Steps to Reproduce

  1. Install HHVM: https://docs.hhvm.com/hhvm/installation/introduction
$ git clone git@github.com:hhvm/hhast.git
$ cd hhast
$ wget https://getcomposer.org/composer.phar
$ hhvm composer.phar install
$ docusuarus-init

Expected Behavior

Creation of a docusaurus skeleton

Actual Behavior

Errors out. Ends with:

(node:2585) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
warning package.json: No license field
$ docusaurus-examples
Wrote docusaurus scripts to package.json file.

.gitignore already exists in /private/tmp/hhast/website. Creating an example gitignore file for you to copy from if desired.

fs.js:145
    throw err;
    ^

Error: ENOTDIR: not a directory, scandir '/private/tmp/hhast/vendor/bin/hh-autoload'
    at Object.fs.readdirSync (fs.js:895:3)
    at print (/private/tmp/hhast/website/node_modules/tree-node-cli/tree.js:82:21)
    at contents.forEach (/private/tmp/hhast/website/node_modules/tree-node-cli/tree.js:114:26)
    at Array.forEach (<anonymous>)
    at print (/private/tmp/hhast/website/node_modules/tree-node-cli/tree.js:112:12)
    at contents.forEach (/private/tmp/hhast/website/node_modules/tree-node-cli/tree.js:114:26)
    at Array.forEach (<anonymous>)
    at print (/private/tmp/hhast/website/node_modules/tree-node-cli/tree.js:112:12)
    at contents.forEach (/private/tmp/hhast/website/node_modules/tree-node-cli/tree.js:114:26)
    at Array.forEach (<anonymous>)
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c docusaurus-examples
Directory: /private/tmp/hhast/website
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/private/tmp/hhast/website/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

yarn-error.log and full terminal log: https://gist.github.com/fredemmott/3755bca61cddc6718afc16ae83979f2f

Reproducible Demo

Covered above. No siteConfig.js as this is a bug in docusuarus-init - it doesn't exist yet.

Reproduces with other hack projects, eg hhvm/hsl. Does not reproduce with mkdir foo; cd foo; mkdir -p vendor/bin; touch vendor/bin/helloworld

@yangshun yangshun self-assigned this Jun 20, 2018
@yangshun
Copy link
Contributor

@fredemmott I wasn't able to reproduce this issue. I cloned https://github.com/hhvm/hhast, did docusaurus-init and the website dir was generated. Do you have any symlinks in your dir?

It seems like it failed in the tree printing step but the directory skeleton generation step should have succeeded.

@yangshun yangshun added the bug An error in the Docusaurus core causing instability or issues with its execution label Jun 20, 2018
@fredemmott
Copy link
Author

fredemmott commented Jun 20, 2018

no symlinks except as created by composer/git - this does mean that vendor/bin/hh-autoload is a symlink.

If composer isn't ran (equivalent to not running npm install):

  • vendor/bin/hh-autoload doesn't exist (vendor as a whole doesn't)
  • there are no symlinks
  • docusaurus-init works fine

@yangshun
Copy link
Contributor

I see. The tree printing library we're using doesn't support symlinks at the moment. But the skeleton should have been generated. Was the skeleton dir generated? Feel free to ping me on Work Chat to discuss about it, I'll be able to respond faster there 😄

@fredemmott
Copy link
Author

hhvm/hh-apidoc#29 is what led to this :)

@yangshun
Copy link
Contributor

yangshun commented Jul 1, 2018

@fredemmott Docusaurus 1.3.1 has been released which should fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

No branches or pull requests

2 participants