今天在学习ES6 let命令时,报错Block-scoped declarations (let, const, function, class) not yet supported outside strict mode at 在网上寻找错误的答案,发现是nodejs版本太低的问题。

首先 node -v 查看当前版本,如果当前版本不合适可以安装指定版本的nodejs

升级之前需要安装n模块,sudo npm install -g n

安装n模块后,n -V查看版本

最后升级指定版本的nodejs,sudo n v14.2.0 (我安装的是当前最新版本)

https://nodejs.org/en/这是nodejs的官网,可下载或查看最新版本

安装指定版本的nodejs,解决Block-scoped declarations (let, const, function, class) not yet supported outside报错
用node -v查看版本,v14.2.0`

相关文章:

  • 2021-04-13
  • 2021-09-28
  • 2021-10-03
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
猜你喜欢
  • 2021-12-20
  • 2021-11-08
  • 2021-12-28
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案