简体   繁体   English

节点键入意外令牌=>

[英]node typings Unexpected token =>

I'm new to nodejs and try to install typings globally to make intellisense available for a few modules by using 我是新来的NodeJS并尝试安装typings ,通过使用全球,使可用于几个模块的智能感知

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)

Your version of Node is outdated. 您的Node版本已过时。 The module you are trying to load uses arrow functions, which is a syntax that was first partially introduced in Node v4.0. 您尝试加载的模块使用箭头功能,这是Node v4.0中首先引入的一种语法。

Note that Node v0.12 went out of long-term support in December 2016, so is no longer supported at all. 请注意,Node v0.12在2016年12月不再提供长期支持,因此完全不再受支持。 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. 此外,许多Node模块都需要Node v4.0或更高版本,这恰恰是因为此版本引入了许多较早版本不可用的新功能。

I would recommend that you upgrade to Node v6.9 (current LTS version) or Node v7.4 (current stable version). 我建议您升级到Node v6.9(当前LTS版本)或Node v7.4(当前稳定版本)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM