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

Cannot find module 'isbinaryfile' #420

Closed
chiubaka opened this issue Jul 4, 2022 · 0 comments · Fixed by #424
Closed

Cannot find module 'isbinaryfile' #420

chiubaka opened this issue Jul 4, 2022 · 0 comments · Fixed by #424

Comments

@chiubaka
Copy link

chiubaka commented Jul 4, 2022

I'm getting an error like this when using yeoman-environment v3.9.1 with yarn v3.2.1 with Plug'n'Play:

 FAIL  src/node-module/NodeModuleGenerator.test.ts
  NodeModuleGenerator
    ✕ creates a package.json file (328 ms)

  ● NodeModuleGenerator › creates a package.json file

    Cannot find module 'isbinaryfile' from '/Users/dchiu/Developer/generator-typescript-package/.yarn/__virtual__/yeoman-environment-virtual-159b0d0798/0/cache/yeoman-environment-npm-3.9.1-6ff00ff453-60a19b9962.zip/node_modules/yeoman-environment/lib/util'

    Require stack:
      .yarn/__virtual__/yeoman-environment-virtual-159b0d0798/0/cache/yeoman-environment-npm-3.9.1-6ff00ff453-60a19b9962.zip/node_modules/yeoman-environment/lib/util/binary-diff.js
      .yarn/__virtual__/yeoman-environment-virtual-159b0d0798/0/cache/yeoman-environment-npm-3.9.1-6ff00ff453-60a19b9962.zip/node_modules/yeoman-environment/lib/util/conflicter.js
      .yarn/__virtual__/yeoman-environment-virtual-159b0d0798/0/cache/yeoman-environment-npm-3.9.1-6ff00ff453-60a19b9962.zip/node_modules/yeoman-environment/lib/environment.js
      .yarn/__virtual__/yeoman-test-virtual-d24845de57/0/cache/yeoman-test-npm-6.3.0-cf0e4ba284-7d8e79fadd.zip/node_modules/yeoman-test/lib/index.js
      src/node-module/NodeModuleGenerator.test.ts

      at resolveSync (.yarn/cache/resolve-patch-46f9469d0d-5656f4d0be.zip/node_modules/resolve/lib/sync.js:111:15)

I'm on jest v28.1.2, which should have pnp support.

I've found that adding isbinaryfile as a dev dependency in my project resolves the error, but seems like this package should have been installed as a sub-dependency of yeoman-environment? I didn't see isbinaryfile in the yeoman-environment package.json file, however. Should it be listed there?

Weird to me that I'd be the first person hitting this given that the offending line was added to this repo 14 months ago, so I have a slight suspicion that this may have something to do with my project set up.

Still, opening this issue in case others are silently coming across the same problem.

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

Successfully merging a pull request may close this issue.

1 participant