linter-markdown icon indicating copy to clipboard operation
linter-markdown copied to clipboard

Error: Could not find module `remark-preset-lint-recommended`

Open oupala opened this issue 7 years ago • 12 comments

I get an error Error: Could not find module remark-preset-lint-recommended while trying to use linter-markdown.

I'm using Atom 1.23.0 for debian. I installed the following package locally, in the same directory as the markdown file I want to lint:

  • "remark-preset-lint-consistent": "^2.0.1",
  • "remark-preset-lint-markdown-style-guide": "^2.1.1",
  • "remark-preset-lint-recommended": "^3.0.1"

I get a basic package.json file

$ more package.json 
{
  "name": "dummy-package",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "[email protected]"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "remark-preset-lint-consistent": "^2.0.1",
    "remark-preset-lint-markdown-style-guide": "^2.1.1",
    "remark-preset-lint-recommended": "^3.0.1"
  }
}

It is not clear for me how to install and use linter-markdown for Atom.

oupala avatar Dec 14 '17 17:12 oupala

@oupala If you use your own configuration, for example if you’d rather not use the defaults, you can use locally installed modules with a remark config file. If you plan on doing this, could you show me the config file as well?

Otherwise, if you’d like to stick with the defaults, you don’t need to add any dependencies.

wooorm avatar May 17 '18 19:05 wooorm

For a default configuration, I don't need any dependencies. But I still have to install remark and remark-cli globally. Am I right?

If I want my own configuration, I have 2 solutions:

  • either I install all dependencies globally, alongside remark and remark-cli
  • either I want a local and specific configuration, I have to add the dependencies in the package.json file

Am I still right?

If yes, I think that it needs to be more clearly explained in the README file.

oupala avatar May 17 '18 20:05 oupala

For a default configuration, I don't need any dependencies. But I still have to install remark and remark-cli globally. Am I right?

If you’re not going to configure linter-markdown, you don’t need to install anything other that linter-markdown in atom.

If I want my own configuration, I have 2 solutions:

Yes, but your first solution doesn’t work currently.

If yes, I think that it needs to be more clearly explained in the README file.

Feel free to create a PR for the docs!

wooorm avatar May 17 '18 20:05 wooorm

PR proposed, see #167

oupala avatar May 19 '18 22:05 oupala

I'm rather confused. If want to use the default configuration that comes "out of the box" with the Atom linter-markdown package, all is well, but if I want to do any configuration whatsoever, I have to install other stuff?

This seems bizarre. I would have thought that I could have just tossed some settings in a ~/.remarkrc file to disable some of the default stuff.

As a novice user, I'm more than satisfied with the default set of plugins. I just want to tweak the settings they're using. Is this not possible without installing other things?

charlesangus avatar Aug 11 '18 00:08 charlesangus

As a novice user, I'm more than satisfied with the default set of plugins. I just want to tweak the settings they're using. Is this not possible without installing other things?

That's it. Due to some bugs and limitations, you cannot tweak configuration without installing some modules.

oupala avatar Aug 11 '18 19:08 oupala

OK, thanks for the confirmation. I'm going to log an issue for that, because this dramatically reduces the utility/convenience of the linter. I don't have npm or nvm installed, so I would have to install one of those, then remark and remark-cli, then whatever packages I'm using, just to get back to the basic functionality that comes with the package...

charlesangus avatar Aug 12 '18 20:08 charlesangus

Did something changed with Atom v32? My config that used to work until recently seems to not work anymore. The error is:

Error: Could not find module remark-lint-list-item-indent at addModule (/home/user/.atom/packages/linter-markdown/node_modules/unified-engine/lib/configuration.js:242:27) at use (/home/user/.atom/packages/linter-markdown/node_modules/unified-engine/lib/configuration.js:203:7) at addEach (/home/user/.atom/packages/linter-markdown/node_modules/unified-engine/lib/configuration.js:186:13) at addPreset (/home/user/.atom/packages/linter-markdown/node_modules/unified-engine/lib/configuration.js:164:9) at merge (/home/user/.atom/packages/linter-markdown/node_modules/unified-engine/lib/configuration.js:150:5) at Config.create (/home/user/.atom/packages/linter-markdown/node_modules/unified-engine/lib/configuration.js:105:5) at done (/home/user/.atom/packages/linter-markdown/node_modules/unified-engine/lib/find-up.js:148:20) at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3) 0:0

And note that the the package remark-lint-list-item-indent is already globally installed.

oupala avatar Oct 25 '18 15:10 oupala

@oupala Have you tried uninstalling and re-installing?

wooorm avatar Oct 28 '18 15:10 wooorm

Nope, I did not tried this.

But what would you reinstall? Which npm modules?

oupala avatar Oct 28 '18 17:10 oupala

Oh sorry, I meant to uninstall the linter-remark plugin, and add it again. Maybe that helps.

wooorm avatar Nov 19 '18 11:11 wooorm

Something must have changed somewhere because it does now work again while I have not modified anything...

oupala avatar Sep 16 '19 14:09 oupala