【问题标题】:npm build failed when adding custom ckeditor5 online build添加自定义 ckeditor5 在线构建时,npm 构建失败
【发布时间】:2021-08-16 09:44:29
【问题描述】:

我使用npm add file:./ckeditor5 添加了 ckeditor5 包。当我运行代码时,代码工作正常,但是当我构建它时,我收到npm ERR! client@0.1.0 build: react-scripts build 的错误。

我猜是npm add file:./ckeditor5 命令的问题。下面是 package.json 文件 `

{
  "name": "client",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@ckeditor/ckeditor5-react": "^3.0.2",
    "@material-ui/core": "^4.11.4",
    "@material-ui/icons": "^4.11.2",
    "@material-ui/lab": "^4.0.0-alpha.58",
    "@testing-library/jest-dom": "^5.12.0",
    "@testing-library/react": "^11.2.7",
    "@testing-library/user-event": "^12.8.3",
    "ckeditor5-custom-build": "file:ckeditor5",
    "moment": "^2.29.1",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-router-dom": "^5.2.0",
    "react-scripts": "4.0.3",
    "socket.io-client": "^4.1.2",
    "web-vitals": "^1.1.2"
  },
  "scripts": {
    "prebuild": "npm add file:./ckeditor5",
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

您可以在此链接上看到完整的错误消息https://pastebin.com/embed_js/tT8uaQVe

谁能帮我解决这个问题。

【问题讨论】:

    标签: node.js npm ckeditor5 ckeditor5-react ckeditor5-plugin


    【解决方案1】:

    我已经找到了这个问题的解决方案。你只需要增加javascript的堆内存。为此,您可以在 package.json 文件中添加以下构建脚本

    "build": "CI= react-scripts --max_old_space_size=4096 build",

    【讨论】:

    • 别忘了回来把它标记为正确答案。
    • @BernardoMarques 是的,兄弟。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-11-07
    • 2021-08-09
    • 1970-01-01
    • 2012-04-21
    • 2021-05-08
    • 2021-02-25
    • 2019-10-16
    相关资源
    最近更新 更多