簡體   English   中英

節點鍵入意外令牌=>

[英]node typings Unexpected token =>

我是新來的NodeJS並嘗試安裝typings ,通過使用全球,使可用於幾個模塊的智能感知

npm install -g typings

執行此命令后,我嘗試使用:

typings search tape

這給了我

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)

您的Node版本已過時。 您嘗試加載的模塊使用箭頭功能,這是Node v4.0中首先引入的一種語法。

請注意,Node v0.12在2016年12月不再提供長期支持,因此完全不再受支持。 此外,許多Node模塊都需要Node v4.0或更高版本,這恰恰是因為此版本引入了許多較早版本不可用的新功能。

我建議您升級到Node v6.9(當前LTS版本)或Node v7.4(當前穩定版本)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM