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: Cannot find module 'uuid' #127

Closed
Jackymancs4 opened this issue Jun 5, 2021 · 3 comments
Closed

Error: Cannot find module 'uuid' #127

Jackymancs4 opened this issue Jun 5, 2021 · 3 comments

Comments

@Jackymancs4
Copy link

Environment

  • Operating System: Ubuntu 18.04.5
  • node --version: v16.3.0
  • npm --version: v7.15.0
  • percollate --version: 1.2.3

Description

Hello @danburzo
After installing with npm install -g percollate launching it always return:

$ percollate epub https://explained-from-first-principles.com/email
node:internal/modules/cjs/loader:944
  throw err;
  ^

Error: Cannot find module 'uuid'
Require stack:
- /home/jack/.nvm/versions/node/v16.3.0/lib/node_modules/percollate/index.js
- /home/jack/.nvm/versions/node/v16.3.0/lib/node_modules/percollate/cli.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:941:15)
    at Function.Module._load (node:internal/modules/cjs/loader:774:27)
    at Module.require (node:internal/modules/cjs/loader:1013:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (/home/jack/.nvm/versions/node/v16.3.0/lib/node_modules/percollate/index.js:15:22)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14)
    at Module.require (node:internal/modules/cjs/loader:1013:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/jack/.nvm/versions/node/v16.3.0/lib/node_modules/percollate/index.js',
    '/home/jack/.nvm/versions/node/v16.3.0/lib/node_modules/percollate/cli.js'
  ]
}

Which indicates that the uuid module is not installed.
Indeed looking at https://github.com/danburzo/percollate/blob/master/package.json it is not specified as a dependency.

Looking here

"uuid": {
it appears to be present, but in very old version (v3 vs the current v8), which most likely does not support modern module import.

Installing uuid as a global package (npm install -g uuid) does fix the problem but should not be necessary.

Fixing the issue seems trivial, so I could open a PR if you like.

Anyway thanks!

@danburzo
Copy link
Owner

danburzo commented Jun 5, 2021

Thanks for the report @Jackymancs4! The code indeed seems to be relying on a transitive dependency on uuid 😬 I'll figure out where in the commit history we lost it. No need for a PR since the fix is trivial, will fix in a sec. I'm curious how exactly it breaks in node 16 / npm 7 vs. node 15 / npm 6.x.

@danburzo
Copy link
Owner

danburzo commented Jun 5, 2021

Should be fixed in percollate@1.2.4, can you let me know if it works correctly on your setup?

@Jackymancs4
Copy link
Author

I confirm that after running:

$ npm remove -g uuid
$ npm update -g percollate
$ percollate --version
1.2.4

everything is working perfectly.
Thanks for the quick fix!

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

2 participants