bandi从3.0.x alpha升级到Beta

时间:2019-11-22 18:54:28

标签: javascript node.js migration strapi

我一直在遵循本教程来研究strapi https://strapi.io/blog/building-a-static-website-using-gatsby-and-strapi 但是安装后,我安装的是alpha而不是beta 我正在尝试升级到beta,所以我按照此处的说明进行操作

https://strapi.io/documentation/3.0.0-beta.x/migration-guide/migration-guide-alpha.26-to-beta.html

我按照说明进行了修改package.json,然后运行npm i,这给了我一个错误notarget No matching version found for strapi-hook-knex@3.0.0-beta.x.

然后,而不是文档中提到的更改与alpha相关的所有beta.x "strapi": "3.0.0-alpha.26.2"-> "strapi": "3.0.0-beta.x" 我做了"strapi": "^3.0.0-beta.17.5"

这使命令npm i成功运行,因此我继续进行说明。完成后,尝试运行strapi develop时遇到错误error Error: Missing extensions folder. Please create one in your app root directory,因此我手动添加了名为extensions的文件夹,然后尝试启动strapi develop,但随后出现错误error Error: Cannot find module 'strapi-hook-bookshelf/lib/utils/'

我尝试删除项目中的node_modules干净的npm缓存以及.cache文件夹,但是这些都不起作用。

这里是经过完全修改的package.json

{
  "name": "cms",
  "private": true,
  "version": "0.1.0",
  "description": "A Strapi application.",
  "main": "./server.js",
  "scripts": {
    "develop": "strapi develop",
    "start": "strapi start",
    "build": "strapi build",
    "strapi": "strapi",
    "lint": "node_modules/.bin/eslint api/**/*.js config/**/*.js plugins/**/*.js"
  },
  "devDependencies": {
    "babel-eslint": "^7.1.1",
    "eslint": "^4.19.1",
    "eslint-config-airbnb": "^13.0.0",
    "eslint-plugin-import": "^2.11.0",
    "eslint-plugin-react": "^7.7.0"
  },
  "dependencies": {
    "axios": "^0.19.0",
    "knex": "latest",
    "lodash": "^4.17.5",
    "pg": "^7.13.0",
    "sqlite3": "latest",
    "strapi": "^3.0.0-beta.17.5",
    "strapi-admin": "^3.0.0-beta.17.5",
    "strapi-email-nodemailer": "^0.2.1",
    "strapi-hook-bookshelf": "^3.0.0-beta.17.5",
    "strapi-hook-knex": "^3.0.0-beta.17.5",
    "strapi-plugin-content-manager": "^3.0.0-beta.17.5",
    "strapi-plugin-content-type-builder": "^3.0.0-beta.17.5",
    "strapi-plugin-email": "^3.0.0-beta.17.5",
    "strapi-plugin-upload": "^3.0.0-beta.17.5",
    "strapi-plugin-users-permissions": "^3.0.0-beta.17.5",
    "strapi-provider-upload-cloudinary": "^3.0.0-beta.17.5",
    "strapi-utils": "^3.0.0-beta.17.5"
  },
  "author": {
    "name": "abc",
    "email": "",
    "url": ""
  },
  "maintainers": [
    {
      "name": "abc",
      "email": "",
      "url": ""
    }
  ],
  "strapi": {
    "uuid": "abcf5f65-060b-43f6-b98d-a4687fd81def"
  },
  "engines": {
    "node": "10.x",
    "npm": ">= 6.0.0"
  },
  "license": "MIT"
}

有人知道我做错了吗?

在此先感谢您的任何建议和帮助。

升级trapi之前的当前版本
Strapi-3.0.0-alpha.26.2(全局)
节点-v10.17.0
npm-6.11.3

1 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。我可以通过清空/api文件夹来解决此问题,然后服务器重新开始工作。