【问题标题】:KeystoneJS can't update postKeystoneJS 无法更新帖子
【发布时间】:2016-07-23 02:26:59
【问题描述】:

更新问题似乎是我无法更新/编辑我的帖子。每次我创建一个新帖子时,它都会进入死循环。请帮帮我T-T

最近我开始使用 keystoneJS 作为我的 CMS 的程序。
一切都很好,但这个 Post 问题。
我发现如果我通过yo keystone(使用由 Yeoman 制作的 KeystoneJS 生成器)安装 keystone-demo,那么发布帖子可以工作,但如果我手动安装 keystone,问题就来了...
在 Google Inspect Console 中,出现错误-
"TypeError: undefined is not an object (evaluating 'refList.expandColumns')"

我猜是keystone版本问题。 这是我的package.json 文件

{
  "name": "keystone-demo",
  "version": "1.0.1",
  "private": true,
  "repository": {
    "type": "git",
    "url": "https://github.com/JedWatson/keystone-demo.git"
  },
  "dependencies": {
    "keystone": "https://github.com/keystonejs/keystone.git",
    "async": "^1.5.0",
    "lodash": "^3.10.1",
    "csv": "^0.4.6",
    "gulp": "^3.9.1",
    "gulp-less": "^3.1.0",
    "gulp-shell": "^0.5.2",
    "gulp-watch": "^4.3.5",
    "pug": "^2.0.0-alpha6"
  },
  "scripts": {
    "start": "node keystone.js"
  }
}

这是package.json文件中可以正常工作的版本

{
  "name": "keystone",
  "version": "0.0.0",
  "private": true,
  "dependencies": {
    "keystone": "^0.3.16",
    "async": "^1.5.0",
    "underscore": "^1.8.3",
    "node-sass": "^3.3.2",
    "node-sass-middleware": "^0.9.7", 
    "dotenv": "^1.1.0"
  },
  "devDependencies": {
    "gulp": "^3.7.0",
    "gulp-jshint": "^1.9.0",
    "jshint-stylish": "^0.1.3",
    "gulp-shell": "^0.5.0",
    "gulp-watch": "^4.3.5",
    "gulp-sass": "^2.0.4"

  },
  "engines": {
    "node": ">=0.10.22",
    "npm": ">=1.3.14"
  },
  "scripts": {
    "start": "node keystone.js"
  },
  "main": "keystone.js"
}

【问题讨论】:

    标签: javascript reactjs babeljs keystonejs


    【解决方案1】:

    您正在从 github 加载最新的 keystone 版本,它并不总是稳定的。这可能是您看到的错误的原因。

    我建议改用发布到 npm 的最新版本(撰写本文时为 0.3.22)。

    将依赖项中的第一行更新为此,它将起作用:

    "keystone": "^0.3.22",
    

    要为新项目添加基石,您还可以输入npm install --save keystone

    【讨论】:

      猜你喜欢
      • 2019-05-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-23
      • 2021-11-07
      • 2021-11-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多