Search code examples
node.jsubuntu-server

Trouble installing audiosprite on Ubuntu Server 16.04


I keep getting this error message, and I'm unable to trouble-shoot this or see where anyone else is having the same problem.

I followed the instructions to install this on Linux, but audiosprite is producing this error message. Is this an issue with audiosprite? Or nodejs? Or something else?

Using v4.2.6 of node if that matters:

# audiosprite --help
/usr/local/lib/node_modules/audiosprite/audiosprite.js:31
  let opts = {}, callback = function(){}
  ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/audiosprite/cli.js:7:19)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)

Solution

  • Upgrade your nodejs and npm version. The keyword let,const are not supported by v4.0. You have to update version

    The module n makes version-management easy:

    sudo npm install n -g
    sudo n 0.12.2
    

    For the latest stable version:

    sudo n stable
    

    For the latest version:

    sudo n latest