Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Uncaught Error: Cannot find module 'remark-lint-no-empty-sections' #51

Closed
ondine opened this issue Mar 1, 2016 · 12 comments
Closed

Uncaught Error: Cannot find module 'remark-lint-no-empty-sections' #51

ondine opened this issue Mar 1, 2016 · 12 comments

Comments

@ondine
Copy link

ondine commented Mar 1, 2016

Steps to reproduce:

  1. Forked and cloned: http:https://ben.balter.com/jekyll-style-guide/
  2. Ran bundle
  3. Opened LICENSE.md in Atom
  4. Error: Cannot find module 'remark-lint-no-empty-sections

Atom Version: 1.5.3
System: Mac OS X 10.10.5
Thrown From: linter-markdown package, v1.5.0

Stack Trace

Uncaught Error: Cannot find module 'remark-lint-no-empty-sections'

At module.js:338

Error: Cannot find module 'remark-lint-no-empty-sections'
    at Module._resolveFilename (module.js:336:15)
    at Function.Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app.asar/src/module-cache.js:383:52)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at loadExternal (/Users/edlc4sz/.atom/packages/linter-markdown/node_modules/remark-lint/lib/index.js:171:12)
    at loadExternals (/Users/edlc4sz/.atom/packages/linter-markdown/node_modules/remark-lint/lib/index.js:202:24)
    at lint (/Users/edlc4sz/.atom/packages/linter-markdown/node_modules/remark-lint/lib/index.js:250:17)
    at Of.use (/Users/edlc4sz/.atom/packages/linter-markdown/node_modules/remark/node_modules/unified/node_modules/attach-ware/index.js:121:21)
    at Processor.use (/Users/edlc4sz/.atom/packages/linter-markdown/node_modules/remark/node_modules/unified/index.js:106:23)
    at /Users/edlc4sz/.atom/packages/linter-markdown/lib/index.js:123:12
    at handleLocalConfiguration (/Users/edlc4sz/.atom/packages/linter-markdown/node_modules/remark/lib/cli/configuration.js:294:9)
    at /Users/edlc4sz/.atom/packages/linter-markdown/node_modules/remark/lib/cli/configuration.js:211:9
    at /Users/edlc4sz/.atom/packages/linter-markdown/node_modules/remark/node_modules/vfile-find-up/index.js:207:17
    at FSReqWrap.oncomplete (fs.js:82:15)

Commands

     -0:02.7.0 markdown-preview:toggle (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-vivid-syntax.theme-one-dark-ui)

Config

{
  "core": {
    "disabledPackages": [
      "markdown-preview"
    ],
    "themes": [
      "one-dark-ui",
      "one-dark-vivid-syntax"
    ]
  }
}

Installed Packages

# User
color-picker, v2.1.1
linter, v1.11.3
linter-markdown, v1.5.0
markdown-deluxe, v1.0.0
markdown-mindmap, v0.2.4
markdown-preview-opener, v0.1.1
markdown-preview-plus, v2.2.2
markdown-scroll-sync, v2.1.2
one-dark-vivid-syntax, v1.1.2

# Dev
No dev packages
@ondine
Copy link
Author

ondine commented Mar 1, 2016

Seems to be on any .md file in the project:

screen shot 2016-03-01 at 9 57 57 am

@Arcanemagus
Copy link
Member

Did you run npm install to install all of the project's dependencies? I'm not sure what exactly you are referring to with bundle, but it looks to be a Ruby on Rails program, and thus it's doubtful that it installs the Node dependencies (of which remark-lint-no-empty-sections is one).

@ondine
Copy link
Author

ondine commented Mar 11, 2016

Just ran npm install and updating an additional Atom package. Will let you know. Thanks for your help!

@kachkaev
Copy link

kachkaev commented May 25, 2016

I've got a similar issue with "remark-lint-sentence-newline" (an external linter rule).
Tried running sudo npm i -g "remark-lint-sentence-newline" and npm i --save-dev "remark-lint-sentence-newline" but this did not help. Restarting Atom had no effect either.

Atom Version: 1.7.4
System: Ubuntu 16.04
Thrown From: linter-markdown package, v1.5.0

Stack Trace

Uncaught Error: Cannot find module 'remark-lint-sentence-newline'

At module.js:340

Error: Cannot find module 'remark-lint-sentence-newline'
    at Module._resolveFilename (module.js:338:15)
    at Function.Module._resolveFilename (/opt/atom/resources/app.asar/src/module-cache.js:383:52)
    at Function.Module._load (module.js:289:25)
    at Module.require (module.js:366:17)
    at require (/opt/atom/resources/app.asar/src/native-compile-cache.js:50:27)
    at loadExternal (/home/lhrazk/.atom/packages/linter-markdown/node_modules/remark-lint/lib/index.js:173:12)
    at loadExternals (/home/lhrazk/.atom/packages/linter-markdown/node_modules/remark-lint/lib/index.js:204:24)
    at lint (/home/lhrazk/.atom/packages/linter-markdown/node_modules/remark-lint/lib/index.js:252:17)
    at Of.use (/home/lhrazk/.atom/packages/linter-markdown/node_modules/remark/node_modules/unified/node_modules/attach-ware/index.js:121:21)
    at Processor.use (/home/lhrazk/.atom/packages/linter-markdown/node_modules/remark/node_modules/unified/index.js:106:23)
    at /home/lhrazk/.atom/packages/linter-markdown/lib/index.js:123:12
    at handleLocalConfiguration (/home/lhrazk/.atom/packages/linter-markdown/node_modules/remark/lib/cli/configuration.js:316:9)
    at /home/lhrazk/.atom/packages/linter-markdown/node_modules/remark/lib/cli/configuration.js:233:9
    at /home/lhrazk/.atom/packages/linter-markdown/node_modules/remark/node_modules/vfile-find-up/index.js:207:17
    at FSReqWrap.oncomplete (fs.js:82:15)

Config

{
  "core": {
    "themes": [
      "atom-light-ui",
      "atom-light-syntax"
    ]
  }
}

Installed Packages

# User
activate-power-mode, v0.5.2
color-picker, v2.1.1
editorconfig, v1.4.1
file-icons, v1.7.12
goto-last-edit, v0.3.0
linter, v1.11.4
linter-eslint, v7.2.2
linter-less, v2.5.0
linter-markdown, v1.5.0
markdown-scroll-sync, v2.1.2
minimap, v4.24.2
open-recent, v5.0.0
project-manager, v2.9.7
react, v0.15.0

# Dev
No dev packages

.remarkrc

{
  "plugins": {
    "lint": {
      "external": ["remark-lint-sentence-newline"],

      "no-multiple-toplevel-headings": false,
      "list-item-indent": false,
      "emphasis-marker": "_",
      "hard-break-spaces": true,
      "heading-style": "setext",
      "fenced-code-marker": "`",
      "final-newline": true,
      "maximum-line-length": false,
      "no-html": false,
      "no-multiple-toplevel-headings": true
    }
  },
  "settings": {
    "commonmark": true
  }
}

@Arcanemagus
Copy link
Member

@kachkaev I'm not sure that global plugins are supported... does it work if you install the plugin in the project?

@kachkaev
Copy link

@Arcanemagus unfortunatelly it does not. Tried both on Ubuntu and OSX. MWE:
https://github.com/kachkaev/linter-markdown-51

@wooorm
Copy link
Contributor

wooorm commented May 26, 2016

Quite the pickle! Thanks for the detailed project, @kachkaev.

I believe, due to some change in atom, remark-lint is no longer able to detect which project the atom-linter is running on, so it can’t seem to find the node_modules/ directory. I believe the solution would be to externalise the logic used in remark-lint, and have linter-markdown load the external rules itself (externals can be an array of objects of ruleIds mapping to functions, too), and pass those instead. I’ll dig into externalising the logic!

@wooorm
Copy link
Contributor

wooorm commented May 26, 2016

@Arcanemagus P.S. Partial support (for globals), could be added by updating remark-lint to 3.2.0-3.2.1, for now.

@wooorm wooorm closed this as completed in 43f375c May 26, 2016
@wooorm
Copy link
Contributor

wooorm commented May 26, 2016

This is fixed, but unfortunately there’s an error in that external rule, which I PRd and you can follow here: why-jay/remark-lint-sentence-newline#23.

@kachkaev
Copy link

kachkaev commented May 26, 2016

Great, thanks @wooorm!

I also encountered that external issue and was about to report it. Happy to see a pull request from you in the repo instead!

@Arcanemagus
Copy link
Member

@wooorm I wonder if it would be beneficial to pin the versions of remark / remark-lint so GreenKeeper would send a PR for every version?

@wooorm
Copy link
Contributor

wooorm commented May 27, 2016

@Arcanemagus, yeah, I think that would pull in more fixes and changes to dependants. I’m 👍!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants