tldrlegal: Error: Cannot find module @babel

Got this error when running against my create-react-app based project, any idea why it crashes?

C:\Projekte\mine>tldrlegal
module.js:550
    throw err;
    ^

Error: Cannot find module 'C:\Projekte\mine/node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/package.json'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at getPackage (C:\Users\rejas\AppData\Roaming\npm\node_modules\tldrlegal\node_modules\legally\lib\legally.js:17:13)
    at packages.reduce (C:\Users\rejas\AppData\Roaming\npm\node_modules\tldrlegal\node_modules\legally\lib\legally.js:36:8)
    at Array.reduce (<anonymous>)
    at module.exports.root (C:\Users\rejas\AppData\Roaming\npm\node_modules\tldrlegal\node_modules\legally\lib\legally.js:34:19)
    at Object.<anonymous> (C:\Users\rejas\AppData\Roaming\npm\node_modules\tldrlegal\index.js:28:16)
    at Module._compile (module.js:653:30)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 22 (9 by maintainers)

Most upvoted comments

@rejas Yes you got it!

I didn’t have yarn installed so that explains why my create-react-app invocation wasn’t creating a broken node_modules/ directory structure that tldrlegal wasn’t liking!

All along that was the difference causing this strange behavior.

Updating tldrlegal to use the latest version of legally in https://github.com/eladnava/tldrlegal/commit/1d3ebed55725b0b6e87de3fd0a3f3b16c6248999 has added support for Yarn’s special node_modules/ format.

Published tldrlegal version 1.0.8 which resolves this.

Thanks all for your help! 🎉