fmarcia / uglifycss

Port of YUI CSS Compressor from Java to NodeJS
MIT License
284 stars 37 forks source link

Error: /usr/local/lib/node_modules/uglifycss/uglifycss:29 #61

Closed Sermanes closed 6 years ago

Sermanes commented 6 years ago
[Assetic\Exception\FilterException]
  An error occurred while running:
  '/usr/bin/nodejs' '/usr/local/bin/uglifycss' '/tmp/assetic_uglifycssZcQFpk'

  Error Output:

  /usr/local/lib/node_modules/uglifycss/uglifycss:29
  const { defaultOptions, processString, processFiles } = require('./')
        ^
  SyntaxError: Unexpected token {
      at Module._compile (module.js:439:25)
      at Object.Module._extensions..js (module.js:474:10)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
      at Function.Module.runMain (module.js:497:10)
      at startup (node.js:119:16)
      at node.js:906:3

I have this error when I try to do an assetic:dump --env=prod in my Symfony application. What can I do to solve it?

If I do the same command but without --env=prod it works.

I have installed uglify-js and uglifycss

morontt commented 6 years ago

Do you have node 6.x version? I had the same problem and it disappeared after the update (node 4.5 -> 6.14)

Sermanes commented 6 years ago

Yep I installed a new version of node and it works! Thank u so much!