代码之家  ›  专栏  ›  技术社区  ›  Kristen Grote

尝试更新到最新NPM版本后出错

  •  0
  • Kristen Grote  · 技术社区  · 6 年前

    我尝试使用以下命令更新NPM:

    sudo npm install -g npm@latest

    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:373:25)
        at Object.Module._extensions..js (module.js:416:10)
        at Module.load (module.js:343:32)
        at Function.Module._load (module.js:300:12)
        at Function.Module.runMain (module.js:441:10)
        at startup (node.js:139:18)
        at node.js:968:3
    

    我试图再次更新,但我得到了错误。我试图卸载,但我得到的错误。我试图安装NVM,但我得到的错误。如果没有这个错误,我现在似乎不能做任何与节点相关的事情。

    1 回复  |  直到 6 年前
        1
  •  0
  •   Kristen Grote    6 年前