mantrajs / mantrajs-atom-package

Mantra JS - Package for Atom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot find module 'CSON'

fermuch opened this issue · comments

To reproduce:

  1. Create a project (meteor create oneapp)
  2. Press ctrl+alt+o

Atom Version: 1.5.3
System: "Funtoo Linux
Thrown From: mantrajs package, v0.2.0

Stack Trace

Failed to activate the mantrajs package

At Cannot find module 'CSON'

Error: Cannot find module 'CSON'
    at Module._resolveFilename (module.js:336:15)
    at Function.Module._resolveFilename (/usr/share/atom/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 (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/home/fermuch/.atom/packages/mantrajs/lib/configHandler.coffee:2:8)
    at Object.<anonymous> (/home/fermuch/.atom/packages/mantrajs/lib/configHandler.coffee:1:1)
    at Module._compile (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .coffee] (/usr/share/atom/resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/home/fermuch/.atom/packages/mantrajs/lib/mantra-view.coffee:6:10)
    at Object.<anonymous> (/home/fermuch/.atom/packages/mantrajs/lib/mantra-view.coffee:1:1)
    at Module._compile (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .coffee] (/usr/share/atom/resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/home/fermuch/.atom/packages/mantrajs/lib/mantrajs.coffee:3:14)
    at Object.<anonymous> (/home/fermuch/.atom/packages/mantrajs/lib/mantrajs.coffee:1:1)
    at Module._compile (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .coffee] (/usr/share/atom/resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (/usr/share/atom/resources/app.asar/src/native-compile-cache.js:50:27)
    at Package.module.exports.Package.requireMainModule (/usr/share/atom/resources/app.asar/src/package.js:720:27)
    at Package.module.exports.Package.activateNow (/usr/share/atom/resources/app.asar/src/package.js:172:16)
    at /usr/share/atom/resources/app.asar/src/package.js:800:25
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:241:20)
    at /usr/share/atom/resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:536:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:359:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeydown (/usr/share/atom/resources/app.asar/src/window-event-handler.js:97:36)
    at HTMLDocument.<anonymous> (/usr/share/atom/resources/app.asar/src/window-event-handler.js:3:61)

Commands

     -0:00.8.0 mantrajs:toggle (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "autoHideMenuBar": true,
    "disabledPackages": [
      "jshint",
      "linter-flow"
    ],
    "projectHome": "/home/fermuch/Documentos/Dev/Work",
    "themes": [
      "one-dark-ui",
      "atom-material-syntax"
    ]
  }
}

Installed Packages

# User
atom-jasmine, v0.8.1
atom-material-syntax, v0.4.3
cson, v2.0.1
linter, v1.11.3
linter-eslint, v6.0.0
linter-js-yaml, v1.2.5
mantrajs, v0.2.0
minimap, v4.19.0
react, v0.14.1
tabs-to-spaces, v1.0.2

# Dev
No dev packages

Unfortunatelly I cannot reproduce. I do not have access to the Linux machine, only Windows and Mac where it is running fine. Weird part is that you DO have cson installed as per list of your installed packages. Not sure what to do here ....

yeah, that's because I tried installing cson.
Can you give me any tip on how to debug the package? I don't have any idea on how atom packages work.

You have installed cson 2.0.1, while package depends on CSON ^3.0.0. Current version of cson is 3.0.2. Not sure why it is installing cson 2 only.

You can try several things.

  1. Download the source of the package to a directory
  2. Run npm install inside that directory and make sure there are no error messages
  3. Report back with any errors
  4. If no errors, run "apm link" in that directory. This willl install plugin to Atom

Other thing to try

  1. Start the devel console "ctrl+alt+i"
  2. Put a breakpoint to the place where cson is required and check whether it detects any cson installation

Other thing to check

  1. Locate the mantra-atom-package installation dir and check whether cson is installed in "node_modules" directory

Well, that about sums it up ;)

Same error with Ubuntu 15.10

Thanks to @aykutyaman and e7b0b28 this is solved in 0.3.0.

Confirmed this is solved in 0.3.0.

Dumb question: OS X filesystem is case insensitive? That sounds silly and weird coming from a UNIX OS 😕

@fermuch, yes, the default setting is the case insensitive FS ;/