Typings: SyntaxError: Unexpected token =>

805 views Asked by At

When running a typings command I always get the error:

AppData\Roaming\npm\node_modules\typings\node_modules\strip-bom\index.js:2
module.exports = x => {
                   ^^
SyntaxError: Unexpected token =>
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (AppData\Roaming\npm\node_modules\typings\node_modules\typings-core\dist\utils\fs.js:5:16)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

So far I tried reinstalling typings (v 2.0.0), npm cache clean and all that, but it doesn't seem to fix it.

2

There are 2 answers

0
Kimy BF On

I just install the new version of node from node page, there is no need of uninstalled it first because the binary files are overwritten.

0
PatrickZheng On

Under windows, I got node version 0.12, uninstalled it, reinstalled the versoin 6.9.x. Problem got solved. Thanks.