【问题标题】:Why babel installation fails with syntax error?为什么 babel 安装失败并出现语法错误?
【发布时间】:2021-08-07 20:31:12
【问题描述】:

有人知道 babel 安装失败并出现以下错误的原因吗?

对应的日志在这里,

【问题讨论】:

    标签: javascript npm babeljs npm-install babel-loader


    【解决方案1】:

    我解决了错误,在我的情况下,npm 崩溃了,我重新安装了 npm,一切都开始恢复正常。

    【讨论】:

      【解决方案2】:

      我认为这会解决。

      npm cache clean --force
      

      yarn cache clean
      

      然后安装 npm

      npm  install --save-dev @babel/cli @babel/preset-react
      

      【讨论】:

      • 缓存清理对我不起作用,但我使用了 yarn add 并且它起作用了!这是 npm 缓存问题吗?
      猜你喜欢
      • 2017-08-28
      • 1970-01-01
      • 2021-07-31
      • 2016-11-08
      • 1970-01-01
      • 2014-06-01
      • 1970-01-01
      • 2021-11-08
      • 1970-01-01
      相关资源
      最近更新 更多