leny / atom-w3c-validation

Validate your HTML and CSS files using W3C validators.
MIT License
12 stars 5 forks source link

Uncaught Error: Cannot find module 'xml2js' #16

Closed loker closed 8 years ago

loker commented 8 years ago

[Enter steps to reproduce below:]

  1. when saving a css... doesn't occur when editing and saving html files.

Atom Version: 1.3.2 System: Mac OS X 10.11.2 Thrown From: w3c-validation package, v0.3.0

Stack Trace

Uncaught Error: Cannot find module 'xml2js'

At module.js:338

Error: Cannot find module 'xml2js'
    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 parseCssValidation (/Users/kloker/.atom/packages/w3c-validation/node_modules/w3cvalidator/lib/w3cjs.js:103:5)
    at /Users/kloker/.atom/packages/w3c-validation/node_modules/w3cvalidator/lib/w3cjs.js:81:29
    at Request.callback (/Users/kloker/.atom/packages/w3c-validation/node_modules/w3cvalidator/node_modules/superagent/lib/node/index.js:630:3)
    at Request.<anonymous> (/Users/kloker/.atom/packages/w3c-validation/node_modules/w3cvalidator/node_modules/superagent/lib/node/index.js:131:10)
    at emitOne (events.js:77:13)
    at Request.emit (events.js:169:7)
    at Stream.<anonymous> (/Users/kloker/.atom/packages/w3c-validation/node_modules/w3cvalidator/node_modules/superagent/lib/node/index.js:773:12)
    at emitNone (events.js:72:20)
    at Stream.emit (events.js:166:7)
    at Unzip.<anonymous> (/Users/kloker/.atom/packages/w3c-validation/node_modules/w3cvalidator/node_modules/superagent/lib/node/utils.js:124:12)
    at emitNone (events.js:72:20)
    at Unzip.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:893:12)
    at doNTCallback2 (node.js:441:9)
    at process._tickCallback (node.js:355:17)

Commands

     -3:28.2.0 core:paste (atom-text-editor.editor.is-focused)
     -3:27.6.0 core:save (atom-text-editor.editor.is-focused)
     -3:26.7.0 core:move-up (atom-text-editor.editor.is-focused)
 13x -3:26 editor:move-to-end-of-word (atom-text-editor.editor.is-focused)
     -3:12.9.0 core:save (atom-text-editor.editor.is-focused.autocomplete-active)
     -3:02.3.0 core:backspace (atom-text-editor.editor.is-focused)
     -3:00.3.0 autocomplete-plus:confirm (atom-text-editor.editor.is-focused.autocomplete-active)
  2x -2:59.3.0 core:save (atom-text-editor.editor.is-focused)
     -2:48 editor:move-to-first-character-of-line (atom-text-editor.editor.is-focused)
     -2:45.8.0 core:save (atom-text-editor.editor.is-focused)
  4x -2:42.4.0 core:undo (atom-text-editor.editor.is-focused)
     -2:40.2.0 core:save (atom-text-editor.editor.is-focused)
     -2:31.5.0 autocomplete-plus:confirm (atom-text-editor.editor.is-focused.autocomplete-active)
     -2:31.5.0 autocomplete-plus:activate (atom-text-editor.editor.is-focused)
     -2:28.9.0 autocomplete-plus:confirm (atom-text-editor.editor.is-focused.autocomplete-active)
  2x -2:28.4.0 core:save (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "native-ui",
      "one-dark-syntax"
    ],
    "ignoredNames": [
      ".git",
      ".DS_Store"
    ]
  }
}

Installed Packages

# User
atom-zurb-foundation, v1.1.1
color-picker, v2.0.14
file-icons, v1.6.13
native-ui, v0.11.0
pigments, v0.19.5
w3c-validation, v0.3.0

# Dev
No dev packages
leny commented 8 years ago

Hey,

Try to run the two following commands in a terminal :

apm rebuild apm rebuild-module-cache

It should fix your issue.

loker commented 8 years ago

Yep! It worked. I'm using atom for a few days now so I could have missed to update cache if it's a common case... Thanks.

leny commented 8 years ago

Its not a common case, it came from the fact that, from a version of this package to another, some of the internal dependencies have changed.

Glad I could help.