Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to activate the atom-beautify package #2342

Open
themakunga opened this issue Apr 23, 2019 · 24 comments
Open

Failed to activate the atom-beautify package #2342

themakunga opened this issue Apr 23, 2019 · 24 comments

Comments

@themakunga
Copy link

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.36.0 x64
Electron: 4.1.1
OS: "Manjaro Linux"
Thrown From: atom-beautify package 0.33.4

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 /packages/atom-beautify/node_modules/prettier/index.js:40203:21
    at createCommonjsModule (/packages/atom-beautify/node_modules/prettier/index.js:193:35)
    at /packages/atom-beautify/node_modules/prettier/index.js:40010:18)
    at /packages/atom-beautify/node_modules/prettier/index.js:42016:3)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .js] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/atom-beautify/src/beautifiers/prettier.coffee:4:12)
    at /packages/atom-beautify/src/beautifiers/prettier.coffee:1:1)
    at /packages/atom-beautify/src/beautifiers/prettier.coffee:1:1)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .coffee] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/atom-beautify/src/beautifiers/index.coffee:120:20
    at arrayMap (/packages/markdown-preview-plus/node_modules/lodash/lodash.js:639:23)
    at Function.map (/packages/markdown-preview-plus/node_modules/lodash/lodash.js:9556:14)
    at /packages/atom-beautify/src/beautifiers/index.coffee:119:22)
    at /packages/atom-beautify/src/beautify.coffee:10:14)
    at /packages/atom-beautify/src/beautify.coffee:2:1)
    at /packages/atom-beautify/src/beautify.coffee:2:1)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .coffee] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at Package.requireMainModule (/usr/lib/atom/src/package.js:776:27)

Commands

     -0:07.4.0 application:add-project-folder (ol.tree-view-root.full-menu.list-tree.has-collapsable-children.focusable-panel)

Non-Core Packages

atom-beautify 0.33.4 
atom-cform 0.6.0 
atom-clock 0.1.16 
busy-signal 2.0.1 
emmet 2.4.3 
file-icons 2.1.31 
intentions 1.1.5 
language-babel 2.85.0 
language-dotenv 1.2.0 
language-jenkinsfile 0.1.1 
language-pug 0.0.22 
language-terraform 0.8.1 
language-vue 0.24.0 
linter 2.3.0 
linter-eslint 8.5.4 
linter-pug 2.0.4 
linter-ui-default 1.7.1 
markdown-preview-plus 3.8.1 
minimap 4.29.9 
nord-atom-syntax 0.9.1 
nord-atom-ui 0.11.0 
northem-dark-atom-syntax 2.1.0 
northem-dark-atom-ui 2.1.0 
sync-settings 0.8.6 
terraform-fmt 0.3.0 
todo-show 2.3.2 
@marvinroman
Copy link

I can confirm the same issue is occurring for me on Manjaro.
Manjaro Linux (KDE)
DISTRIB_ID=ManjaroLinux
DISTRIB_RELEASE=18.0.4

@BradleyinLville
Copy link

I have the issue as well.
Manjaro Linux (Gnome)
[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.36.0 x64
Electron: 4.1.1
OS: "Manjaro Linux"
Thrown From: atom-beautify package 0.33.4

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 /packages/atom-beautify/node_modules/prettier/index.js:40747:21
    at createCommonjsModule (/packages/atom-beautify/node_modules/prettier/index.js:188:35)
    at /packages/atom-beautify/node_modules/prettier/index.js:40554:18)
    at /packages/atom-beautify/node_modules/prettier/index.js:42567:3)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .js] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/atom-beautify/src/beautifiers/prettier.coffee:4:12)
    at /packages/atom-beautify/src/beautifiers/prettier.coffee:1:1)
    at /packages/atom-beautify/src/beautifiers/prettier.coffee:1:1)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .coffee] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/atom-beautify/src/beautifiers/index.coffee:120:20
    at arrayMap (/packages/atom-beautify/node_modules/lodash/lodash.js:639:23)
    at Function.map (/packages/atom-beautify/node_modules/lodash/lodash.js:9556:14)
    at /packages/atom-beautify/src/beautifiers/index.coffee:119:22)
    at /packages/atom-beautify/src/beautify.coffee:10:14)
    at /packages/atom-beautify/src/beautify.coffee:2:1)
    at /packages/atom-beautify/src/beautify.coffee:2:1)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .coffee] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at Package.requireMainModule (/usr/lib/atom/src/package.js:776:27)

Commands

Non-Core Packages

atom-beautify 0.33.4 
atom-material-syntax 1.0.8 
atom-material-ui 2.1.3 
cssbeautify 1.3.0 

@TeHMoroS
Copy link

Same thing for me on Arch Linux. I've got the same stack trace output, etc., so I'll skip pasting it here, so the issue doesn't get too long with almost identical pastes. ;)

@TeHMoroS
Copy link

TeHMoroS commented Apr 26, 2019

This seems to be a problem with one of the dependencies: prettier and not atom-beautify itself. It does a very strange eval() call, which seems to be redundant and from what I understand from the upstream issue, it's generated by a parser that's used to build the project.

Upstream issue: prettier/prettier#6053

Workaround

Fire up the ~/.atom/packages/atom-beautify/node_modules/prettier/index.js file (possible line numbers: 33160, 40204 or 40747 - as stated in the comments below) and change:
var utilInspect = eval("require('util').inspect");
to
var utilInspect = require('util').inspect;

After restarting the stack trace will go away and atom-beautify will function normally until an update is available. 😄

@A2-NieR
Copy link

A2-NieR commented Apr 27, 2019

@TeHMoroS For me it was in line 40747 :)

@themakunga
Copy link
Author

for me was the line 40204

@zaoqi
Copy link

zaoqi commented Apr 28, 2019

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.36.0 x64
Electron: 4.1.1
OS: "Manjaro Linux"
Thrown From: atom-beautify package 0.33.4

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 /packages/atom-beautify/node_modules/prettier/index.js:40747:21
    at createCommonjsModule (/packages/atom-beautify/node_modules/prettier/index.js:188:35)
    at /packages/atom-beautify/node_modules/prettier/index.js:40554:18)
    at /packages/atom-beautify/node_modules/prettier/index.js:42567:3)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .js] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/atom-beautify/src/beautifiers/prettier.coffee:4:12)
    at /packages/atom-beautify/src/beautifiers/prettier.coffee:1:1)
    at /packages/atom-beautify/src/beautifiers/prettier.coffee:1:1)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .coffee] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/atom-beautify/src/beautifiers/index.coffee:120:20
    at arrayMap (/packages/atom-beautify/node_modules/lodash/lodash.js:639:23)
    at Function.map (/packages/atom-beautify/node_modules/lodash/lodash.js:9556:14)
    at /packages/atom-beautify/src/beautifiers/index.coffee:119:22)
    at /packages/atom-beautify/src/beautify.coffee:10:14)
    at /packages/atom-beautify/src/beautify.coffee:2:1)
    at /packages/atom-beautify/src/beautify.coffee:2:1)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .coffee] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at Package.requireMainModule (/usr/lib/atom/src/package.js:776:27)

Commands

     -0:12.7.0 application:open-file (a.btn-issue.btn.btn-error)

Non-Core Packages

atom-beautify 0.33.4 
atom-ide-terminal 5.0.1 

@luxedo
Copy link

luxedo commented Apr 29, 2019

Same here. @TeHMoroS workaround totally worked! The line number was 39937 for me.

@crabvk
Copy link

crabvk commented May 2, 2019

There is comment in ~/.atom/packages/atom-beautify/node_modules/prettier/index.js says:

// plugin will look for `eval("require")()` and transform to `require()` in the bundle,
// and rewrite the paths to require from the top-level.
// We need to list the parsers and getters so we can load them only when necessary.

🤔

@BradleyinLville
Copy link

Sorry forgot to reply. The edit fixed my problem. I was 40747.

Thanks!!

@plankobostjan
Copy link

@TeHMoroS workaround worked for me too! Thanks!

The line number was 40635 :)

@mon0theist
Copy link

Same issue happening for me on Arch Linux

@TeHMoroS 's fix worked for me as well, line 40747

@saltybuckets
Copy link

@TeHMoroS could it be because of not having installed the formatter

@marcelloinfoweb
Copy link

Help me!

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.36.1 x64
Electron: 4.1.4
OS: "Manjaro Linux"
Thrown From: atom-beautify package 0.33.4

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 /packages/atom-beautify/node_modules/prettier/index.js:40756:21
    at createCommonjsModule (/packages/atom-beautify/node_modules/prettier/index.js:188:35)
    at /packages/atom-beautify/node_modules/prettier/index.js:40563:18)
    at /packages/atom-beautify/node_modules/prettier/index.js:42576:3)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .js] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/atom-beautify/src/beautifiers/prettier.coffee:9:14)
    at /packages/atom-beautify/src/beautifiers/prettier.coffee:77:4)
    at /packages/atom-beautify/src/beautifiers/prettier.coffee:81:3)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .coffee] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at /packages/atom-beautify/src/beautifiers/index.coffee:97:22
    at arrayMap (/packages/atom-beautify/node_modules/lodash/lodash.js:639:23)
    at Function.map (/packages/atom-beautify/node_modules/lodash/lodash.js:9556:14)
    at /packages/atom-beautify/src/beautifiers/index.coffee:95:28)
    at /packages/atom-beautify/src/beautify.coffee:15:16)
    at /packages/atom-beautify/src/beautify.coffee:587:4)
    at /packages/atom-beautify/src/beautify.coffee:591:3)
    at Module._compile (/usr/lib/atom/src/native-compile-cache.js:87:30)
    at Object.value [as .coffee] (/usr/lib/atom/src/compile-cache.js:235:23)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (internal/modules/cjs/loader.js:640:17)
    at require (/usr/lib/atom/src/native-compile-cache.js:47:27)
    at Package.requireMainModule (/usr/lib/atom/src/package.js:776:27)
    at Package.activateNow (/usr/lib/atom/src/package.js:214:34)
    at activationHookSubscriptions.add.packageManager.onDidTriggerActivationHook (/usr/lib/atom/src/package.js:895:75)
    at Function.simpleDispatch (/usr/lib/atom/node_modules/event-kit/dist/emitter.js:64:14)
    at Emitter.emit (/usr/lib/atom/node_modules/event-kit/dist/emitter.js:257:28)
    at triggeredActivationHooks.forEach.hook (/usr/lib/atom/src/package-manager.js:712:80)
    at Set.forEach (<anonymous>:null:null)
    at PackageManager.activatePackage (/usr/lib/atom/src/package-manager.js:712:37)
    at /usr/lib/atom/node_modules/settings-view/lib/package-manager.js:477:29
    at exit (/usr/lib/atom/node_modules/settings-view/lib/package-manager.js:114:16)
    at triggerExitCallback (/usr/lib/atom/src/buffered-process.js:258:9)
    at bufferStream (/usr/lib/atom/src/buffered-process.js:279:9)
    at Socket.stream.on (/usr/lib/atom/src/buffered-process.js:155:7)
    at Socket.emit (events.js:187:15)
    at Pipe._handle.close (net.js:606:12)

Commands

  2x -8:30.3.0 incompatible-packages:view (div.incompatible-packages-status.inline-block.text.text-error)

Non-Core Packages

atom-beautify 0.33.4 
atom-ide-ui 0.13.0 
ide-php 0.7.18 

@luxedo
Copy link

luxedo commented May 21, 2019

@marcelloinfoweb
check this workaround

This seems to be a problem with one of the dependencies: prettier and not atom-beautify itself. It does a very strange eval() call, which seems to be redundant and from what I understand from the upstream issue, it's generated by a parser that's used to build the project.

Upstream issue: prettier/prettier#6053

Workaround

Fire up the ~/.atom/packages/atom-beautify/node_modules/prettier/index.js file (possible line numbers: 33160, 40204 or 40747 - as stated in the comments below) and change:
var utilInspect = eval("require('util').inspect");
to
var utilInspect = require('util').inspect;

After restarting the stack trace will go away and atom-beautify will function normally until an update is available.

@marcelloinfoweb
Copy link

It's already this way.

Captura de tela de 2019-05-21 22-13-51

@luxedo
Copy link

luxedo commented May 22, 2019

Are you changing the file at ~/.atom/packages/atom-beautify/node_modules/prettier/index.js? By looking at your stack trace it seems that that it's unchanged.

@marcelloinfoweb
Copy link

marcelloinfoweb commented May 22, 2019

Yes, when I opened the file, it was this way, I did not make any changes.

I removed the extension, rebooted Atom and reinstalled, now it seems to be working fine.

If you come back to give the mistake, I'll come back here with the problem, okay?

Thanks for listening!

@DaSniper12
Copy link

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.40.1 x64
Electron: 3.1.10
OS: Microsoft Windows 10 Home
Thrown From: atom-beautify package 0.33.4

Stack Trace

Failed to activate the atom-beautify package

At Cannot find module './compile'

Error: Cannot find module './compile'
    at Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
    at Module._resolveFilename (~/AppData/Local/atom/app-1.40.1/resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.get_Module._resolveFilename (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:155413)
    at Module.require (/app.asar/static/index.js:61:43)
    at require (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:146745)
    at /packages/atom-beautify/node_modules/har-validator/node_modules/ajv/lib/ajv.js:3:21)
    at /packages/atom-beautify/node_modules/har-validator/node_modules/ajv/lib/ajv.js:499:3)
    at Module.get_Module._compile (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:147429)
    at Object.value [as .js] (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
    at Function.Module._load (internal/modules/cjs/loader.js:551:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:146745)
    at /packages/atom-beautify/node_modules/har-validator/lib/promise.js:1:166)
    at /packages/atom-beautify/node_modules/har-validator/lib/promise.js:104:3)
    at Module.get_Module._compile (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:147429)
    at Object.value [as .js] (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
    at Function.Module._load (internal/modules/cjs/loader.js:551:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:146745)
    at /packages/atom-beautify/node_modules/request/lib/har.js:5:16)
    at /packages/atom-beautify/node_modules/request/lib/har.js:207:3)
    at Module.get_Module._compile (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:147429)
    at Object.value [as .js] (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
    at Function.Module._load (internal/modules/cjs/loader.js:551:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:146745)
    at /packages/atom-beautify/node_modules/request/request.js:23:11)
    at /packages/atom-beautify/node_modules/request/request.js:1553:3)
    at Module.get_Module._compile (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:147429)
    at Object.value [as .js] (~/AppData/Local/atom/app-1.40.1/resources/app/static/<embedded>:11:150977)

Commands

Non-Core Packages

atom-beautify 0.33.4 
atom-clock 0.1.17 
Hydrogen 2.10.3 
local-history 4.3.1 

I tried finding the line index.js in the prettier folder and this is what I got: http://prntscr.com/p4q6aa

@27Bslash6
Copy link

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.41.0 x64
Electron: 4.2.7
OS: Microsoft Windows 10 Pro
Thrown From: atom-beautify package 0.33.4

Stack Trace

Failed to activate the atom-beautify package

At Invalid or unexpected token

C:\Users\fish\.atom\packages\atom-beautify\src\beautify.coffee:1
(function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { 
                                                                                                                                                           

SyntaxError: Invalid or unexpected token
    at new Script (vm.js:79:7)
    at NativeCompileCache.runInThisContext (~/AppData/Local/atom/app-1.41.0/resources/app/static/<embedded>:11:146322)
    at Module.get_Module._compile (~/AppData/Local/atom/app-1.41.0/resources/app/static/<embedded>:11:147206)
    at Object.value [as .coffee] (~/AppData/Local/atom/app-1.41.0/resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (internal/modules/cjs/helpers.js:20:18)
    at customRequire (~/AppData/Local/atom/app-1.41.0/resources/app/static/<embedded>:1:727373)
    at Package.requireMainModule (~/AppData/Local/atom/app-1.41.0/resources/app/static/<embedded>:11:3325206)
    at Package.activateNow (~/AppData/Local/atom/app-1.41.0/resources/app/static/<embedded>:11:3313190)
    at string.e.trim.length.activationHookSubscriptions.add.packageManager.onDidTriggerActivationHook (~/AppData/Local/atom/app-1.41.0/resources/app/static/<embedded>:14:2607)
    at Function.simpleDispatch (~/AppData/Local/atom/app-1.41.0/resources/app/static/<embedded>:11:1211909)
    at Emitter.emit (~/AppData/Local/atom/app-1.41.0/resources/app/static/<embedded>:11:1213350)
    at PackageManager.triggerDeferredActivationHooks (~/AppData/Local/atom/app-1.41.0/resources/app/static/<embedded>:11:382998)
    at activatePromise.Promise.all.then (~/AppData/Local/atom/app-1.41.0/resources/app/static/<embedded>:11:381749)

Commands

Non-Core Packages

atom-beautify 0.33.4 
atom-ide-ui 0.13.0 
emmet 2.4.3 
file-icons 2.1.36 
git-blame 1.8.0 
highlight-selected 0.16.0 
ide-yaml 0.5.1 
linter 2.3.1 
linter-shellcheck 1.6.0 
minimap 4.29.9 
teletype 0.13.4 

@27Bslash6
Copy link

Tried uninstall, reinstalling multiple times, restarting Atom, installing from gui or apm.

@KerimOfUniverse
Copy link

Did anyone get a solution? I have the same error

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.46.0 x64
Electron: 4.2.7
OS: Microsoft Windows 10 Pro
Thrown From: atom-beautify package 0.33.4

Stack Trace

Failed to activate the atom-beautify package

At Invalid or unexpected token

C:\Users\Kerko\.atom\packages\atom-beautify\node_modules\bluebird\js\release\promise.js:1
(function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { 
                                                                                                                                                           

SyntaxError: Invalid or unexpected token
    at new Script (vm.js:79:7)
    at NativeCompileCache.runInThisContext (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:146322)
    at Module.get_Module._compile (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:147206)
    at Object.value [as .js] (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:146745)
    at /packages/atom-beautify/node_modules/bluebird/js/release/bluebird.js:9:16)
    at /packages/atom-beautify/node_modules/bluebird/js/release/bluebird.js:13:3)
    at Module.get_Module._compile (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:147429)
    at Object.value [as .js] (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:146745)
    at /packages/atom-beautify/src/beautifiers/index.coffee:3:11)
    at /packages/atom-beautify/src/beautifiers/index.coffee:1:1)
    at /packages/atom-beautify/src/beautifiers/index.coffee:1:1)
    at Module.get_Module._compile (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:147429)
    at Object.value [as .coffee] (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:146745)
    at /packages/atom-beautify/src/beautify.coffee:9:15)
    at /packages/atom-beautify/src/beautify.coffee:2:1)
    at /packages/atom-beautify/src/beautify.coffee:2:1)
    at Module.get_Module._compile (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:147429)
    at Object.value [as .coffee] (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:150977)
    at Module.load (internal/modules/cjs/loader.js:602:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
    at Function.Module._load (internal/modules/cjs/loader.js:533:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (internal/modules/cjs/helpers.js:20:18)
    at customRequire (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:1:721712)
    at Package.requireMainModule (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:3299000)
    at Package.activateNow (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:3286984)
    at string.e.trim.length.activationHookSubscriptions.add.packageManager.onDidTriggerActivationHook (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:14:2607)
    at Function.simpleDispatch (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:1215907)
    at Emitter.emit (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:1217348)
    at PackageManager.triggerDeferredActivationHooks (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:383144)
    at activatePromise.Promise.all.then (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:381895)

Commands

     -6:57.2.0 application:open-file (input.hidden-input)

Non-Core Packages

atom-beautify 0.33.4 
atom-html-preview 0.2.6 
atom-ternjs 0.20.0 
autoclose-html 0.23.0 
csslint 1.2.0 
emmet 2.4.3 
language-ejs 0.4.0 
linter 2.3.1 
linter-eslint 8.5.5 
pigments 0.40.2 
Sublime-Style-Column-Selection 1.7.5 

@pardyalbert
Copy link

OS: Microsoft Windows 10 Enterprise
Thrown From: atom-beautify package 0.33.4

Stack Trace

Failed to activate the atom-beautify package

Has Anyone find a Solution ?

Cannot find module './winston/transports'
Require stack:

  • C:\Users\PC.atom\packages\atom-beautify\node_modules\winston\lib\winston.js
  • C:\Users\PC.atom\packages\atom-beautify\src\logger.coffee
  • C:\Users\PC.atom\packages\atom-beautify\src\beautifiers\index.coffee
  • C:\Users\PC.atom\packages\atom-beautify\src\beautify.coffee
  • C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app.asar\static\index.html
    Hide Stack Trace
    Error: Cannot find module './winston/transports'
    Require stack:
  • C:\Users\PC.atom\packages\atom-beautify\node_modules\winston\lib\winston.js
  • C:\Users\PC.atom\packages\atom-beautify\src\logger.coffee
  • C:\Users\PC.atom\packages\atom-beautify\src\beautifiers\index.coffee
  • C:\Users\PC.atom\packages\atom-beautify\src\beautify.coffee
  • C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app.asar\static\index.html
    at Module._resolveFilename (internal/modules/cjs/loader.js:683:15)
    at Module._resolveFilename (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\electron.asar\common\reset-search-paths.js:43:12)
    at Function.get_Module._resolveFilename (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:155482)
    at Module.require (file:///C:/Users/PC/AppData/Local/atom/app-1.49.0/resources/app.asar/static/index.js:61:43)
    at require (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:146814)
    at Object. (C:\Users\PC.atom\packages\atom-beautify\node_modules\winston\lib\winston.js:19:22)
    at Object. (C:\Users\PC.atom\packages\atom-beautify\node_modules\winston\lib\winston.js:167:3)
    at Module.get_Module._compile (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:147498)
    at Object.value [as .js] (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:151046)
    at Module.load (internal/modules/cjs/loader.js:701:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:633:12)
    at Function.Module._load (internal/modules/cjs/loader.js:625:3)
    at Module.require (file:///C:/Users/PC/AppData/Local/atom/app-1.49.0/resources/app.asar/static/index.js:72:46)
    at require (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:146814)
    at file:///C:/Users/PC/.atom/packages/atom-beautify/src/logger.coffee:10:13
    at Object. (file:///C:/Users/PC/.atom/packages/atom-beautify/src/logger.coffee:4:18)
    at Object. (file:///C:/Users/PC/.atom/packages/atom-beautify/src/logger.coffee:1:1)
    at Object. (file:///C:/Users/PC/.atom/packages/atom-beautify/src/logger.coffee:1:1)
    at Module.get_Module._compile (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:147498)
    at Object.value [as .coffee] (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:151046)
    at Module.load (internal/modules/cjs/loader.js:701:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:633:12)
    at Function.Module._load (internal/modules/cjs/loader.js:625:3)
    at Module.require (file:///C:/Users/PC/AppData/Local/atom/app-1.49.0/resources/app.asar/static/index.js:72:46)
    at require (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:146814)
    at Object. (file:///C:/Users/PC/.atom/packages/atom-beautify/src/beautifiers/index.coffee:6:10)
    at Object. (file:///C:/Users/PC/.atom/packages/atom-beautify/src/beautifiers/index.coffee:1:1)
    at Object. (file:///C:/Users/PC/.atom/packages/atom-beautify/src/beautifiers/index.coffee:1:1)
    at Module.get_Module._compile (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:147498)
    at Object.value [as .coffee] (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:151046)
    at Module.load (internal/modules/cjs/loader.js:701:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:633:12)
    at Function.Module._load (internal/modules/cjs/loader.js:625:3)
    at Module.require (file:///C:/Users/PC/AppData/Local/atom/app-1.49.0/resources/app.asar/static/index.js:72:46)
    at require (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:146814)
    at Object. (file:///C:/Users/PC/.atom/packages/atom-beautify/src/beautify.coffee:9:15)
    at Object. (file:///C:/Users/PC/.atom/packages/atom-beautify/src/beautify.coffee:2:1)
    at Object. (file:///C:/Users/PC/.atom/packages/atom-beautify/src/beautify.coffee:2:1)
    at Module.get_Module._compile (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:147498)
    at Object.value [as .coffee] (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:151046)
    at Module.load (internal/modules/cjs/loader.js:701:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:633:12)
    at Function.Module._load (internal/modules/cjs/loader.js:625:3)
    at Module.require (file:///C:/Users/PC/AppData/Local/atom/app-1.49.0/resources/app.asar/static/index.js:72:46)
    at require (internal/modules/cjs/helpers.js:14:16)
    at customRequire (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:1:735013)
    at Package.requireMainModule (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:3308425)
    at Package.activateNow (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:3296409)
    at C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:14:2607
    at Function.simpleDispatch (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:1201500)
    at Emitter.emit (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:1202941)
    at C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:383233
    at Set.forEach ()
    at PackageManager.activatePackage (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:383195)
    at C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:926825
    at r (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:11:921431)
    at n (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:14:1063434)
    at ChildProcess. (C:\Users\PC\AppData\Local\atom\app-1.49.0\resources\app\static<embedded>:14:1063640)
    at ChildProcess.emit (events.js:194:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
    The error was thrown from the atom-beautify package. This issue has already been reported.

@I-Cat
Copy link

I-Cat commented Aug 8, 2020

Same Issue I uninstalled.

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

No branches or pull requests