-
Notifications
You must be signed in to change notification settings - Fork 8
Cannot find module 'lint' (with global remark-lint install) #115
Comments
Hi, thanks for raising this! I did some investigation today, and you’re right: globally installed So the thing is, to find globally installed modules, Now, Atom/Electron need to do funky stuff. So they ship their own version of npm, which is configured to install global modules in And Anyway, for now you cannot use global plugins in atom, unfortunately. |
Oh and you can also set a prefix to your global npm modules, in an |
It seems that I have the same problem as @brettz9. I'm using Atom on linux and I'm also using nvm. My globally installed node modules path is then a bit strange: /home/<user>/.nvm/versions/node/v<version>/lib/node_modules/ This makes the right path hard to guess unless you know which version of node to use (and hence which I have globally installed Error: Cannot find module `lint`at line 0 col 0
at /home/<user>/.atom/packages/linter-markdown/node_modules/unified-engine/lib/file-pipeline/configure.js:68:19
at /home/<user>/.atom/packages/linter-markdown/node_modules/unified-engine/lib/configuration.js:444:7
at Array.forEach (native)
at /home/<user>/.atom/packages/linter-markdown/node_modules/unified-engine/lib/configuration.js:443:13
at /home/<user>/.atom/packages/linter-markdown/node_modules/unified-engine/lib/configuration.js:327:5
at /home/<user>/.atom/packages/linter-markdown/node_modules/vfile-find-up/index.js:135:9
at FSReqWrap.oncomplete (fs.js:123:15) With no |
@oupala Did you see my previous comment? nvm is fine, but Atom explicitly hides the info we need from us, and we can’t easily get around it (eush77/npm-prefix#1). For now the solution is to use locally installed modules! |
Yes, I've read your comment. How can I install the modules locally? What do you mean by locally? And what modules are necessary? |
The normal behaviour, The modules you need to install, differ based on your |
It is a pain to use, but the workaround works... When you use markdown on a lot of repos, it just don't make it to install packages locally on every repo (especially when they are not managed by npm). I hope that the upstream bug will be fixed as soon as possible! |
Just to check, when you say locally, you mean: in the same directory as the markdown files are stored? |
In the directory of your |
I tried to install the following npm packages locally (where the markdown files are stored):
I added a {
"presets": [
"lint-recommended",
"lint-consistent"
],
"plugins": {
"lint": {
"list-item-indent": "mixed",
"table-cell-padding": "false"
}
}
} I have the following atom packages installed:
And when I open a markdown file, here is the error that appears in the linter ui:
I can't succeed to make the markdown linter to work! Please help if you understand something in my mess... |
I just pushed better support for global modules, but it probably requires some set-up on your part. Hope this helps, cheers, |
Thanks a lot @wooorm for this update. Do we have to update linter-markdown on our side? If yes, could you tell us when the new release of linter-markdown will be available on Atom's repo? |
GH-143 only adds docs for this feature, as the feature was implemented a level deeper (in |
It seems to work well, but I had to install everything locally. Is there a way to install and configure the linter user-wide so I get the same configuration for all the markdown files I'm editing? |
If you are using a |
I still find it difficult to lint my markdown files with a user-wide configuration. Here's what I've done:
As my {
"plugins": [
"remark-preset-lint-recommended",
["remark-lint-list-item-indent", "space"],
"remark-preset-lint-consistent"
]
} then I also need to install
Do you think it is a right guide of enabling this feature? |
@oupala If I follow exactly these steps I get:
Does it work for you? |
@jmatsushita Here is what I have installed:
And everything work (except the fact that I can disable a rule enabled by a preset see issue #156 that you created). I don't really want to uninstall everything just to try to install it again. I'm afraid of not being able to install it again and make it work. |
I applied this workaround #156 (comment) from @wooorm and it solved the rule disabling as well as the |
Using Atom 1.10.2 and
remark-lint
installed globally, I'm getting "Cannot find module 'lint'" with the following.remarkrc
:The text was updated successfully, but these errors were encountered: