Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

3.13.0 (latest) fails to run with MODULE_NOT_FOUND #368

Closed
MikeMcC399 opened this issue Nov 5, 2024 · 12 comments
Closed

3.13.0 (latest) fails to run with MODULE_NOT_FOUND #368

MikeMcC399 opened this issue Nov 5, 2024 · 12 comments

Comments

@MikeMcC399
Copy link

MikeMcC399 commented Nov 5, 2024

Current behavior

After updating from markdown-link-check@3.12.2 to markdown-link-check@3.13.0 (latest), markdown-link-check fails to run.

The failure occurs independently of the Node.js version (v18.20.4, v20.18.0, v22.11.0 & v23.1.0)

Expected behavior

markdown-link-check should run and not fail.

Steps to reproduce

Component Version
Ubuntu 24.04.1 LTS
Node.js 22.11.0
markdown-link-check 3.13.0
mkdir markdown-link-check-test
cd markdown-link-check-test
npm init -y
npm install markdown-link-check@latest
touch test.md
npx markdown-link-check test.md

Logs

mike@ubuntu-24:~/github/markdown-link-check-test$ npx markdown-link-check test.md
node:internal/modules/cjs/loader:1249
  const err = new Error(message);
              ^

Error: Cannot find module '/home/mike/github/markdown-link-check-test/reporters/default.js'
Require stack:
- /home/mike/github/markdown-link-check-test/node_modules/markdown-link-check/markdown-link-check
    at Function._resolveFilename (node:internal/modules/cjs/loader:1249:15)
    at Function._load (node:internal/modules/cjs/loader:1075:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Module.require (node:internal/modules/cjs/loader:1340:12)
    at require (node:internal/modules/helpers:141:16)
    at getInputs (/home/mike/github/markdown-link-check-test/node_modules/markdown-link-check/markdown-link-check:154:61)
    at main (/home/mike/github/markdown-link-check-test/node_modules/markdown-link-check/markdown-link-check:251:20) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/mike/github/markdown-link-check-test/node_modules/markdown-link-check/markdown-link-check'
  ]
}

Node.js v22.11.0
@dklimpel
Copy link
Contributor

dklimpel commented Nov 5, 2024

I can confirm it.

@dklimpel
Copy link
Contributor

dklimpel commented Nov 5, 2024

@MikeMcC399
Copy link
Author

MikeMcC399 commented Nov 5, 2024

7f524dd

input.opts.reporters = program.opts().reporters ?? [require(path.resolve('reporters', 'default.js'))];

Perhaps @dudeofawesome could take a look?

@tcort
Copy link
Owner

tcort commented Nov 5, 2024

I have a fix. Stand by. :)

@dhpollack
Copy link

50 minutes for a fix, what took you so long? 😆 💯

@tcort tcort closed this as completed in c801280 Nov 5, 2024
@MikeMcC399
Copy link
Author

MikeMcC399 commented Nov 5, 2024

@tcort

3.13.1 also fails for me, but with a slightly different stack trace

$ npx markdown-link-check test.md
node:internal/modules/cjs/loader:1252
  throw err;
  ^

Error: Cannot find module './reporters'
Require stack:
- /home/mike/github/markdown-link-check-test/node_modules/markdown-link-check/markdown-link-check
    at Function._resolveFilename (node:internal/modules/cjs/loader:1249:15)
    at Function._load (node:internal/modules/cjs/loader:1075:27)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Module.require (node:internal/modules/cjs/loader:1340:12)
    at require (node:internal/modules/helpers:141:16)
    at Object.<anonymous> (/home/mike/github/markdown-link-check-test/node_modules/markdown-link-check/markdown-link-check:15:19)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Object..js (node:internal/modules/cjs/loader:1689:10)
    at Module.load (node:internal/modules/cjs/loader:1318:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/mike/github/markdown-link-check-test/node_modules/markdown-link-check/markdown-link-check'
  ]
}

Node.js v22.11.0

@dklimpel
Copy link
Contributor

dklimpel commented Nov 5, 2024

Docker image seems to "work". But every check writes a "junit.xml"

@tcort
Copy link
Owner

tcort commented Nov 5, 2024

Docker image seems to "work". But every check writes a "junit.xml"

I just pushed a fix for that.

@tcort tcort reopened this Nov 5, 2024
@tcort
Copy link
Owner

tcort commented Nov 5, 2024

@tcort

13.13.1 also fails for me, but with a slightly different stack trace

Working on a fix.

@tcort tcort closed this as completed in c6bd140 Nov 5, 2024
@MikeMcC399
Copy link
Author

MikeMcC399 commented Nov 5, 2024

@tcort

It looks like the npm package markdown-link-check does not publish the directory reporters

image

It's not fixed in 3.13.2 either.

@MikeMcC399
Copy link
Author

MikeMcC399 commented Nov 5, 2024

@tcort

3.13.3 also fails

Check out the documentation for package.json

https://docs.npmjs.com/cli/v10/configuring-npm/package-json

I guess you would need to specify either directories or files to get the reporters directory published.

@tcort
Copy link
Owner

tcort commented Nov 5, 2024

I've never encountered this sort of thing before, and I've been using node.js since 2014. I just did a quick fix to include the reporters in markdown-link-check. I'll try to figure out what went wrong later.

andrzej-stencel added a commit to andrzej-stencel/opentelemetry-collector that referenced this issue Nov 5, 2024
To prevent it from using v3.13.x which is currently broken by tcort/markdown-link-check#368.
jackgopack4 pushed a commit to jackgopack4/opentelemetry-collector that referenced this issue Nov 5, 2024
To prevent it from using v3.13.x which is currently broken by tcort/markdown-link-check#368.
codeboten pushed a commit to open-telemetry/opentelemetry-collector that referenced this issue Nov 5, 2024
To prevent it from using v3.13.x which is currently broken by
tcort/markdown-link-check#368.
djaglowski pushed a commit to djaglowski/opentelemetry-collector that referenced this issue Nov 21, 2024
HongChenTW pushed a commit to HongChenTW/opentelemetry-collector that referenced this issue Dec 19, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants