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 'editions' #1088

Closed
dstack opened this issue Aug 29, 2018 · 4 comments
Closed

Error: Cannot find module 'editions' #1088

dstack opened this issue Aug 29, 2018 · 4 comments

Comments

@dstack
Copy link

dstack commented Aug 29, 2018

Fresh install of docpad, locally or globally, I get the same error.

docpad: 6.81.0 and 6.80.9
node: 10.9.0
npm: 6.4.0
Windows 10

Error: Cannot find module 'editions'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object. (D:\Apps\dscom5\node_modules\docpad\bin.js:2:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)

This specific example is from "docpad init" but I get the same running "docpad -v", really anything with docpad.

@dstack
Copy link
Author

dstack commented Aug 29, 2018

@balupton after some trial and error, I have established that the module "editions" is in fact installed, in a spot that globally installed docpad can reach it. From what I have found so far, only modules using editions are having problems loading, which I verified by modifying bin.js to try and load "ambi" first.

My hunch is that the initial require for "editions" is attempting to load editions/package.json -> main. From there, it's a number of possibilities:

  • the folders containing the editions are named like "editionnode0.8" on windows (character refuses to print here, it's a very small bullet, have not tracked down the unicode for it yet)
  • editions is attempting to use itself to load itself
  • Node 10.9.0 incompatibility
  • NPM 6.4.0 incompatibility

@balupton
Copy link
Member

balupton commented Aug 29, 2018

@dstack
Copy link
Author

dstack commented Aug 29, 2018

Thanks @balupton 👍 .

For anyone else that runs into this on windows, falling back to docpad@6.79.0 resolves this.

@balupton
Copy link
Member

balupton commented Sep 3, 2018

this should now be resolved for most packages

resolution in docpad will take a bit longer... it will now show up however as could not find docpad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants