DavidAnson / vscode-markdownlint

Markdown linting and style checking for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
MIT License
930 stars 170 forks source link

markdownlint extension v0.48 does not load in versions of VS Code earlier than v1.66 (Cannot find module 'node:path') #250

Closed john-corcoran closed 1 year ago

john-corcoran commented 2 years ago

Hi, I'm having trouble loading markdownlint versions 0.48.0 and 0.48.1 in my VS Code environment, although reverting to version 0.47.0 works fine.

My VS Code environment is: Version: 1.64.2 (Universal) Commit: f80445acd5a3dadef24aa209168452a3d97cc326 Date: 2022-02-09T22:00:58.347Z (6 mos ago) Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Darwin x64 21.4.0

I tried the troubleshooting guidance in a previous 'stopped working' issue - confirmed that markdownlint is installed and that issue applies to all opened Markdown files. There is no output visible for markdown in the 'Output' tab. Haven't been able to test on another machine yet, but will update the ticket later when I've tried on a newer VS Code build.

When trying to use one of the markdownlint commands in the Command Pallete, I get example error:

Command 'Toggle linting by markdownlint on/off (temporarily)' resulted in an error (command 'markdownlint.toggleLinting' not found)

Happy to provide any other troubleshooting info as beneficial?

carlAlex commented 2 years ago

Hello! I have the same problem as @john-corcoran. With Dev Tools console in VSCode I get this, maybe it can help:

mainThreadExtensionService.ts:95 Activating extension 'DavidAnson.vscode-markdownlint' failed: Cannot find module 'node:path' Require stack:

Version 0.47 works on my system.

Edit: Remove my username..

DavidAnson commented 2 years ago

@john-corcoran, your version of Code is fairly old. Do you see the same problem on a recent version?

@carlAlex, you don't provide the Code version, but I'm guessing the same feedback applies to you?

The syntax "node:path" is somewhat new and may not be supported by the version of Node bundled with older releases of Code. This syntax is not necessary here, but I also don't want to support arbitrarily old versions of Code. I've tried to be conservative about updating the version of Code the extension requires, but that means things like this can happen because I only ever test on the latest version. If we establish this problem is a versioning issue, I will probably update the minimum version for the extension such that installing it on older versions of Code is blocked (I hope).

john-corcoran commented 2 years ago

Hi @DavidAnson, confirmed markdownlint V0.48.1 is working fine with a more recent VS Code build, as follows:

Version: 1.71.0 Commit: 784b0177c56c607789f9638da7b6bf3230d47a8c Date: 2022-09-01T07:25:38.437Z (11 hrs ago) Electron: 19.0.12 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Darwin x64 21.6.0 Sandboxed: No