KeystoneJS 无法更新 post
KeystoneJS can't update post
UPDATE It seems the problem is I can't update/edit my post. Every time I create a new post, then it enter dead loop. Please help me T-T
最近我启动了一个使用 keystoneJS 作为我的 CMS 的程序。
一切顺利,但这个 Post 问题。
我发现如果我通过 yo keystone
(使用 Yeoman 制作的 KeystoneJS 生成器)安装 keystone-demo 然后发布 post 可以工作,但是如果我手动安装 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"
}
您正在从 github 加载最新的 keystone 版本,该版本并不总是稳定的。这可能是您看到错误的原因。
我建议改用发布到 npm 的最新版本(撰写本文时为 0.3.22)。
将依赖项中的第一行更新为此,它将起作用:
"keystone": "^0.3.22",
要将 keystone 添加到新项目,您还可以键入 npm install --save keystone
UPDATE It seems the problem is I can't update/edit my post. Every time I create a new post, then it enter dead loop. Please help me T-T
最近我启动了一个使用 keystoneJS 作为我的 CMS 的程序。
一切顺利,但这个 Post 问题。
我发现如果我通过 yo keystone
(使用 Yeoman 制作的 KeystoneJS 生成器)安装 keystone-demo 然后发布 post 可以工作,但是如果我手动安装 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"
}
您正在从 github 加载最新的 keystone 版本,该版本并不总是稳定的。这可能是您看到错误的原因。
我建议改用发布到 npm 的最新版本(撰写本文时为 0.3.22)。
将依赖项中的第一行更新为此,它将起作用:
"keystone": "^0.3.22",
要将 keystone 添加到新项目,您还可以键入 npm install --save keystone