【问题标题】:Error: "Module parse failed: Unexpected token" when building react-static app template错误:构建 react-static 应用程序模板时出现“模块解析失败:意外令牌”
【发布时间】:2019-08-16 16:51:15
【问题描述】:

我在从 react-static 空白模板创建新应用时遇到此错误,在清理 windows 环境并重新安装 nodejs 和 react-static 后,遵循this 程序。

错误 /.../react-static-test/react-static-test/dist/react-static-templates.js 1:1051 模块解析失败:意外令牌 (1:1051) 您可能需要一个 适当的加载器来处理这种文件类型。

程序很好,帮助我多次通过,但由于某种原因,react-static 的包树中存在一些不稳定。

【问题讨论】:

    标签: reactjs npm react-static


    【解决方案1】:

    这里的解决方案,取自 react-static support,因为下一个人不必为它挖掘网络:

    1. rm -rf 节点模块
    2. rm -rf package-lock.json
    3. npm 安装
    4. npm install acorn@6.0.5 -D
    5. npm 运行服务

    根据 react-static 支持帖子,这是一个 npm 错误。

    【讨论】:

      猜你喜欢
      • 2023-01-12
      • 2021-11-26
      • 1970-01-01
      • 2021-05-01
      • 1970-01-01
      • 2020-11-20
      • 2020-06-13
      • 2020-04-22
      • 2021-11-29
      相关资源
      最近更新 更多