Closed zinizhu closed 8 months ago
Hey! :wave: @zinizhu
Thanks for your bug report.
I don't know exactly what could be the cause, but you should be able to run npm install --save-dev markdownlint-rule-relative-links@2.1.0
instead of npm install -g markdownlint-rule-relative-links@2.1.0
in your GitHub workflow, and it should work.
Thanks for the fast response! A bit more details on the background:
I am working on a GitHub Action that use markdownlint-cli2 to lint changed Markdown files. This means the lint can be run in any project (JS, Java, Golang...). The problem with using npm install --dev
is that for projects managed with yarn
, I am hitting this error:
$npm install markdownlint-rule-relative-links@2.1.0 --save-dev
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: jest-config@29.7.0
npm WARN Found: @types/node@20.8.4
npm WARN node_modules/jest-config/node_modules/@types/node
npm WARN
npm WARN Could not resolve dependency:
npm WARN peerOptional @types/node@"*" from jest-config@29.7.0
npm WARN node_modules/jest-config
npm WARN jest-config@"^29.7.0" from create-jest@29.7.0
npm WARN node_modules/create-jest
npm WARN 1 more (jest-cli)
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "link:": link:../app
npm ERR! A complete log of this run can be found in:
npm ERR! /usr/local/google/home/ziniz/.npm/_logs/2023-10-19T17_27_06_802Z-debug-0.log
So I was thinking to avoid this issue I could use the --global
flag, but then there is the issue I mentioned above that the linter cannot find the installed package.
Any suggestion on how I should implement that?
Sorry for the late response. From what I understand, your issue have been solved. https://github.com/DavidAnson/markdownlint-cli2/issues/224#issuecomment-1773252499
Will close this issue for now. Feel free to open another issue, if there is something not working with this custom rule. :smile:
I am trying to use markdownlint-cli2 as part of my CI GitHub workflow. To install this package it runs:
npm install -g markdownlint-rule-relative-links@2.1.0
However when I run the markdownlint-cli2 action it gives me
Steps To Reproduce
The current behavior
The markdownlint-cli cannot find the installed package.
The expected behavior
The action should run without error.