KeystoneJS可以't更新帖子

KeystoneJS can't update post

本文关键字:更新 可以 KeystoneJS      更新时间:2023-09-26

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

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

我想这是关键版本的问题。这是我的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"
}

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

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

更新你的依赖关系中的第一行,它就会起作用:

"keystone": "^0.3.22",

要将keystone添加到新项目中,您还可以键入npm install --save keystone