1

I'm new to nodejs and try to install typings globally to make intellisense available for a few modules by using

npm install -g typings

After this command I try to use:

typings search tape

which gives me

C:\Users\x\AppData\Roaming\npm\node_modules\typings\node_modules\typings-core\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> (C:\Users\x\AppData\Roaming\npm\node_modules\typings\node_modules\typings-core\node_modules\jspm-config\dist\es5\utils\fs.js:5:16)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
yakya
  • 4,559
  • 2
  • 29
  • 31

1 Answers1

2

Your version of Node is outdated. The module you are trying to load uses arrow functions, which is a syntax that was first partially introduced in Node v4.0.

Note that Node v0.12 went out of long-term support in December 2016, so is no longer supported at all. In addition, many Node modules require Node v4.0 or later, exactly because this version introduced a lot of new features that are not available in earlier versions.

I would recommend that you upgrade to Node v6.9 (current LTS version) or Node v7.4 (current stable version).

Frxstrem
  • 38,761
  • 9
  • 79
  • 119
  • Our corporate PCs have this version installed so it's not possible for me to upgrade it unfortunately. I will try to install older version of typings then. Or try to use tsd maybe.., – yakya Jan 28 '17 at 14:33