Atom-beautify: Failed to activate the atom-beautify package

Created on 17 Feb 2017  路  10Comments  路  Source: Glavin001/atom-beautify

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.12.6
Electron Version: 1.3.9
System: Microsoft Windows 10 Pro
Thrown From: atom-beautify package, v0.29.17

Stack Trace

Failed to activate the atom-beautify package

At Cannot find module 'event-kit'

Error: Cannot find module 'event-kit'
    at Module._resolveFilename (module.js:455:15)
    at Module._resolveFilename (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\electron.asar\common\reset-search-paths.js:35:12)
    at Function.Module._resolveFilename (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\src\module-cache.js:383:52)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\src\native-compile-cache.js:50:27)
    at Object.<anonymous> (file:///C:/Users/Ismail H Rana/.atom/packages/atom-beautify/src/beautify.coffee:7:25)
    at Object.<anonymous> (file:///C:/Users/Ismail H Rana/.atom/packages/atom-beautify/src/beautify.coffee:2:1)
    at Module._compile (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\src\native-compile-cache.js:103:30)
    at Object.value [as .coffee] (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\src\compile-cache.js:201:21)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\src\native-compile-cache.js:50:27)
    at Package.module.exports.Package.requireMainModule (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\src\package.js:741:27)
    at Package.module.exports.Package.activateNow (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\src\package.js:174:16)
    at C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\src\package.js:821:25
    at Function.module.exports.Emitter.simpleDispatch (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\node_modules\event-kit\lib\emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\node_modules\event-kit\lib\emitter.js:129:28)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\src\command-registry.js:240:20)
    at C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\src\command-registry.js:3:59
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:587:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:382:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\src\window-event-handler.js:106:36)
    at HTMLDocument.<anonymous> (C:\Users\Ismail H Rana\AppData\Local\atom\app-1.12.6\resources\app.asar\src\window-event-handler.js:3:59)

Commands

     -0:12.4.0 atom-beautify:beautify-editor (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "automaticallyUpdate": false,
    "disabledPackages": [
      "metrics",
      "exception-reporting",
      "language-clojure",
      "language-coffee-script",
      "language-csharp",
      "language-git",
      "language-go",
      "language-java",
      "language-mustache",
      "language-make",
      "language-objective-c",
      "language-perl",
      "language-property-list",
      "language-python",
      "language-ruby",
      "language-ruby-on-rails",
      "language-shellscript",
      "language-source",
      "language-todo",
      "language-toml",
      "language-yaml",
      "link",
      "welcome"
    ],
    "telemetryConsent": "no"
  }
}

Installed Packages

# User
atom-beautify, v0.29.17 (active)
html-to-css, v0.2.2 (inactive)
minimap, v4.25.7 (active)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.52.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.45.0 (inactive)
base16-tomorrow-dark-theme, v1.3.0 (inactive)
base16-tomorrow-light-theme, v1.3.0 (inactive)
one-dark-ui, v1.6.2 (active)
one-light-ui, v1.6.2 (inactive)
one-dark-syntax, v1.5.0 (active)
one-light-syntax, v1.5.0 (inactive)
solarized-dark-syntax, v1.0.5 (inactive)
solarized-light-syntax, v1.0.5 (inactive)
about, v1.7.0 (active)
archive-view, v0.62.0 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.13.1 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.4 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (active)
background-tips, v0.26.1 (active)
bookmarks, v0.42.0 (active)
bracket-matcher, v0.82.2 (active)
command-palette, v0.39.0 (inactive)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.40.0 (inactive)
find-and-replace, v0.202.2 (inactive)
fuzzy-finder, v1.4.0 (active)
git-diff, v1.1.0 (active)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.2 (active)
image-view, v0.60.0 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.2 (inactive)
markdown-preview, v0.158.8 (active)
metrics, v1.1.2 (inactive)
notifications, v0.65.1 (active)
open-on-github, v1.2.1 (inactive)
package-generator, v1.0.1 (inactive)
settings-view, v0.243.1 (active)
snippets, v1.0.4 (active)
spell-check, v0.68.4 (active)
status-bar, v1.4.1 (active)
styleguide, v0.47.2 (active)
symbols-view, v0.113.1 (inactive)
tabs, v0.103.0 (active)
timecop, v0.33.2 (active)
tree-view, v0.210.0 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.35.1 (inactive)
whitespace, v0.35.0 (active)
wrap-guide, v0.38.2 (active)
language-c, v0.54.0 (active)
language-clojure, v0.22.1 (inactive)
language-coffee-script, v0.48.0 (inactive)
language-csharp, v0.13.0 (inactive)
language-css, v0.40.1 (active)
language-gfm, v0.88.0 (active)
language-git, v0.15.0 (inactive)
language-go, v0.43.0 (inactive)
language-html, v0.47.1 (active)
language-hyperlink, v0.16.1 (active)
language-java, v0.24.0 (inactive)
language-javascript, v0.122.0 (active)
language-json, v0.18.3 (active)
language-less, v0.29.6 (active)
language-make, v0.22.2 (inactive)
language-mustache, v0.13.0 (inactive)
language-objective-c, v0.15.1 (inactive)
language-perl, v0.37.0 (inactive)
language-php, v0.37.3 (active)
language-property-list, v0.8.0 (inactive)
language-python, v0.45.1 (inactive)
language-ruby, v0.70.2 (inactive)
language-ruby-on-rails, v0.25.1 (inactive)
language-sass, v0.57.0 (active)
language-shellscript, v0.23.0 (inactive)
language-source, v0.9.0 (inactive)
language-sql, v0.25.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.29.1 (inactive)
language-toml, v0.18.1 (inactive)
language-xml, v0.34.12 (active)
language-yaml, v0.27.1 (inactive)

# Dev
No dev packages
<INSERT CODE HERE>

Expected Output

The beautified code should have looked like this:

<INSERT CODE HERE>

Actual Output

The beautified code actually looked like this:

<INSERT CODE HERE>

Steps to Reproduce

  1. Add code to Atom editor
  2. Run command Atom Beautify: Beautify Editor
  3. This beautified code does not look right!

Debug

Here is a link to the debug.md Gist:

Checklist

I have:

  • [x] Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • [x] Reloaded (or restarted) Atom to ensure it is not a caching issue
  • [ ] Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues
    so I know this is not a duplicate issue
  • [x] Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
  • [ ] Generated debugging information by executing Atom Beautify: Help Debug Editor command in Atom and added link for debug.md Gist to this issue
bug

Most helpful comment

Closing this with apm install atom-beautify as solution. Please let us know if there are any more problems.

All 10 comments

Have you gone through the CheckList ?

Checklist

  • [ ] Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • [ ] Reloaded (or restarted) Atom to ensure it is not a caching issue
  • [ ] Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues so I know this is not a duplicate issue
  • [ ] Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
  • [ ] Generated debugging information by executing Atom Beautify: Help Debug Editor command in Atom and added link for debug.md Gist to this issue

Are you trying to use a local version of atom-beautify for development?

I've just had that case and fixed it with an apm install in the development clone.

[Enter steps to reproduce:]

  1. Install Beautify through Atom downloader
  2. Attempt to Beautify a document via Command Palette

Atom: 1.14.3 x64
Electron: 1.3.13
OS: Mac OS X 10.12.1
Thrown From: atom-beautify package 0.29.17

Stack Trace

Failed to activate the atom-beautify package

At Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".


EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".

    at Ajv.localCompile (/packages/atom-beautify/node_modules/ajv/lib/compile/index.js:139:26)
    at Ajv.resolve (/packages/atom-beautify/node_modules/ajv/lib/compile/resolve.js:53:19)
    at Object.resolveRef (/packages/atom-beautify/node_modules/ajv/lib/compile/index.js:210:21)
    at /packages/atom-beautify/node_modules/ajv/lib/dotjs/ref.js:22:22)
    at /packages/atom-beautify/node_modules/ajv/lib/dotjs/validate.js:156:37)
    at /packages/atom-beautify/node_modules/ajv/lib/dotjs/properties.js:199:26)
    at generate_validate (/packages/atom-beautify/node_modules/ajv/lib/dotjs/validate.js:229:37)
    at localCompile (/packages/atom-beautify/node_modules/ajv/lib/compile/index.js:99:22)
    at Ajv.compile (/packages/atom-beautify/node_modules/ajv/lib/compile/index.js:67:13)
    at _compile (/packages/atom-beautify/node_modules/ajv/lib/ajv.js:328:29)
    at getSchema (/packages/atom-beautify/node_modules/ajv/lib/ajv.js:192:51)
    at validate (/packages/atom-beautify/node_modules/ajv/lib/ajv.js:91:11)
    at validateSchema (/packages/atom-beautify/node_modules/ajv/lib/ajv.js:162:19)
    at _addSchema (/packages/atom-beautify/node_modules/ajv/lib/ajv.js:288:7)
    at addSchema (/packages/atom-beautify/node_modules/ajv/lib/ajv.js:133:26)
    at addInitialSchemas (/packages/atom-beautify/node_modules/ajv/lib/ajv.js:396:39)
    at /packages/atom-beautify/node_modules/ajv/lib/ajv.js:78:3)
    at /packages/atom-beautify/node_modules/har-validator/lib/node4/promise.js:43:11)
    at Module._compile (/app.asar/src/native-compile-cache.js:109:30)
    at /app.asar/src/compile-cache.js:216:21)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (/app.asar/src/native-compile-cache.js:50:27)
    at /packages/atom-beautify/node_modules/request/lib/har.js:5:16)
    at Module._compile (/app.asar/src/native-compile-cache.js:109:30)
    at /app.asar/src/compile-cache.js:216:21)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (/app.asar/src/native-compile-cache.js:50:27)
    at /packages/atom-beautify/node_modules/request/request.js:25:31)
    at Module._compile (/app.asar/src/native-compile-cache.js:109:30)
    at /app.asar/src/compile-cache.js:216:21)

Commands

     -0:54.4.0 command-palette:toggle (input.hidden-input)
     -0:51 atom-beautify:beautify-editor (input.hidden-input)

Non-Core Packages

atom-beautify 0.29.17 

@aaronbannin Yours is a separate and unrelated issue described in https://github.com/Glavin001/atom-beautify/issues/1543

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.15.0 x64
Electron: 1.3.13
OS: Unknown Windows version
Thrown From: atom-beautify package 0.29.17

Stack Trace

Failed to activate the atom-beautify package

At Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".


EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".

    at Ajv.localCompile (/packages/atom-beautify/node_modules/ajv/lib/compile/index.js:139:26)
    at Ajv.resolve (/packages/atom-beautify/node_modules/ajv/lib/compile/resolve.js:53:19)
    at Object.resolveRef (/packages/atom-beautify/node_modules/ajv/lib/compile/index.js:210:21)
    at /packages/atom-beautify/node_modules/ajv/lib/dotjs/ref.js:22:22)
    at /packages/atom-beautify/node_modules/ajv/lib/dotjs/validate.js:156:37)
    at /packages/atom-beautify/node_modules/ajv/lib/dotjs/properties.js:199:26)
    at generate_validate (/packages/atom-beautify/node_modules/ajv/lib/dotjs/validate.js:229:37)
    at localCompile (/packages/atom-beautify/node_modules/ajv/lib/compile/index.js:99:22)
    at Ajv.compile (/packages/atom-beautify/node_modules/ajv/lib/compile/index.js:67:13)
    at _compile (/packages/atom-beautify/node_modules/ajv/lib/ajv.js:328:29)
    at getSchema (/packages/atom-beautify/node_modules/ajv/lib/ajv.js:192:51)
    at validate (/packages/atom-beautify/node_modules/ajv/lib/ajv.js:91:11)
    at validateSchema (/packages/atom-beautify/node_modules/ajv/lib/ajv.js:162:19)
    at _addSchema (/packages/atom-beautify/node_modules/ajv/lib/ajv.js:288:7)
    at addSchema (/packages/atom-beautify/node_modules/ajv/lib/ajv.js:133:26)
    at addInitialSchemas (/packages/atom-beautify/node_modules/ajv/lib/ajv.js:396:39)
    at /packages/atom-beautify/node_modules/ajv/lib/ajv.js:78:3)
    at /packages/atom-beautify/node_modules/har-validator/lib/node4/promise.js:43:11)
    at Module._compile (/app.asar/src/native-compile-cache.js:109:30)
    at /app.asar/src/compile-cache.js:216:21)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (/app.asar/src/native-compile-cache.js:50:27)
    at /packages/atom-beautify/node_modules/request/lib/har.js:5:16)
    at Module._compile (/app.asar/src/native-compile-cache.js:109:30)
    at /app.asar/src/compile-cache.js:216:21)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (/app.asar/src/native-compile-cache.js:50:27)
    at /packages/atom-beautify/node_modules/request/request.js:25:31)
    at Module._compile (/app.asar/src/native-compile-cache.js:109:30)
    at /app.asar/src/compile-cache.js:216:21)

Commands

     -8:19.6.0 application:open (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
     -4:28.9.0 core:save (input.hidden-input)
     -1:18.3.0 atom-beautify:beautify-editor (a.btn-issue.btn.btn-error)
     -1:14.4.0 atom-beautify:help-debug-editor (a.btn-issue.btn.btn-error)

Non-Core Packages

atom-beautify 0.29.17 
minimap 4.26.8 
pigments 0.39.1 
texter 0.1.0 

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.15.0 x64
Electron: 1.3.13
OS: Mac OS X 10.12.3
Thrown From: atom-beautify package 0.29.17

Stack Trace

Failed to activate the atom-beautify package

At Cannot find module 'event-kit'

Error: Cannot find module 'event-kit'
    at Module._resolveFilename (module.js:455:15)
    at Module._resolveFilename (/Applications/Atom.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.Module._resolveFilename (/app.asar/src/module-cache.js:383:52)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (/app.asar/src/native-compile-cache.js:50:27)
    at /packages/atom-beautify-master/src/beautify.coffee:7:25)
    at /packages/atom-beautify-master/src/beautify.coffee:2:1)
    at Module._compile (/app.asar/src/native-compile-cache.js:109:30)
    at /app.asar/src/compile-cache.js:216:21)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (/app.asar/src/native-compile-cache.js:50:27)
    at Package.module.exports.Package.requireMainModule (/app.asar/src/package.js:796:27)
    at Package.module.exports.Package.activateNow (/app.asar/src/package.js:207:16)
    at /app.asar/src/package.js:876:25
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:240:20)
    at /app.asar/src/command-registry.js:3:59
    at Object.didConfirmSelection (/app.asar/node_modules/command-palette/lib/command-palette-view.js:106:29)
    at SelectListView.confirmSelection (/app.asar/node_modules/atom-select-list/src/select-list-view.js:301:20)
    at HTMLDivElement.coreConfirm (/app.asar/node_modules/atom-select-list/src/select-list-view.js:67:14)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
    at /app.asar/src/command-registry.js:3:59
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:599:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:390:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/app.asar/src/window-event-handler.js:106:36)
    at /app.asar/src/window-event-handler.js:3:59)

Commands

     -0:57.4.0 core:move-right (input.hidden-input)
     -0:57 editor:newline (input.hidden-input)
     -0:55.2.0 core:move-left (input.hidden-input)
     -0:53.6.0 core:move-right (input.hidden-input)
     -0:53.3.0 editor:newline (input.hidden-input)
  7x -0:51.8.0 core:move-left (input.hidden-input)
     -0:46.1.0 editor:newline (input.hidden-input)
     -0:45.7.0 core:move-up (input.hidden-input)
     -0:44.1.0 core:move-left (input.hidden-input)
     -0:42.3.0 core:move-right (input.hidden-input)
     -0:41.3.0 core:move-left (input.hidden-input)
     -0:40.4.0 core:move-right (input.hidden-input)
  4x -0:38.7.0 core:move-left (input.hidden-input)
     -0:28.6.0 command-palette:toggle (input.hidden-input)
     -0:25.3.0 core:confirm (input.hidden-input)
     -0:25 atom-beautify:beautify-editor (input.hidden-input)

Non-Core Packages

atom-beautify 0.29.17 

Could you guys perform a apm install atom-beautify and see if you are still having this problem. The dependency was updated to fix this.

no longer getting this error after apm install atom-beautify.

Closing this with apm install atom-beautify as solution. Please let us know if there are any more problems.

there is another way
1.download the zip file
2.unzip it to .atom/packages
3.cd atom-beautify

  1. npm install
    5.restart atom
    it works for me.
Was this page helpful?
0 / 5 - 0 ratings