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 '@postlight/mercury-parser' #1929

Open
ecliptik opened this issue Jan 25, 2025 · 0 comments
Open

Error: Cannot find module '@postlight/mercury-parser' #1929

ecliptik opened this issue Jan 25, 2025 · 0 comments

Comments

@ecliptik
Copy link

When running Newsblur locally, the node container will continue restarting with the error,

[2025-01-25 00:03:55]  --->  ---> No .env file found, using defaults
internal/modules/cjs/loader.js:1032
  throw err;
  ^

Error: Cannot find module '@postlight/mercury-parser'
Require stack:
- /srv/original_text.js
- /srv/newsblur.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
    at Function.Module._load (internal/modules/cjs/loader.js:898:27)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
    at require (internal/modules/cjs/helpers.js:73:18)
    at Object.<anonymous> (/srv/original_text.js:5:13)
    at Object.<anonymous> (/srv/original_text.js:56:4)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/srv/original_text.js', '/srv/newsblur.js' ]
}

Looking at the mercury-parser on npmjs, it has the message,

This project has been renamed to @postlight/parser. Install using @postlight/parser instead.

Changing node/original_text.coffee and node/original_text.js to use @postlight/parser allows the container to start up properly,

diff --git a/node/original_text.coffee b/node/original_text.coffee
index 3af479e8a..3d0786ff8 100644
--- a/node/original_text.coffee
+++ b/node/original_text.coffee
@@ -1,4 +1,4 @@
-Mercury = require('@postlight/mercury-parser')
+Mercury = require('@postlight/parser')
 log    = require './log.js'

 original_text = (app) =>
diff --git a/node/original_text.js b/node/original_text.js
index 437565464..9a7b83ad4 100644
--- a/node/original_text.js
+++ b/node/original_text.js
@@ -2,7 +2,7 @@
 (function() {
   var Mercury, log, original_text;

-  Mercury = require('@postlight/mercury-parser');
+  Mercury = require('@postlight/parser');

   log = require('./log.js');
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

1 participant