【问题标题】:I am trying to deploy a nextJS blog integrated with graphCMS to vercel but i am getting a couple of errors我正在尝试将与 graphCMS 集成的 nextJS 博客部署到 vercel,但我遇到了一些错误
【发布时间】:2022-10-17 22:28:33
【问题描述】:

单击框架预设并部署到 vercel 后,我收到此错误:

在您的项目中无法检测到 Next.js 版本。确保"next" 安装在“dependencies”或“devDependencies”中

即使我的依赖项中有下一个,如下所示:

{
    "private": true,
    "scripts": {
        "dev": "next dev",
        "build": "next build",
        "start": "next start"
    },
    "dependencies": {
        "graphql": "^16.6.0",
        "graphql-request": "^5.0.0",
        "html-react-parser": "^3.0.4",
        "moment": "^2.29.4",
        "next": "^12.3.1",
        "nextjs": "^0.0.3",
        "react": "^18.2.0",
        "react-dom": "^18.2.0",
        "react-multi-carousel": "^2.8.2",
        "sass": "^1.54.9"
    },
    "devDependencies": {
        "@types/node": "17.0.35",
        "@types/react": "18.0.9",
        "@types/react-dom": "18.0.5",
        "autoprefixer": "^10.4.7",
        "postcss": "^8.4.14",
        "tailwindcss": "^3.1.2",
        "typescript": "4.7.2"
    }
}

如何修复此错误并成功部署,因为当我将预设更改为“其他”时,它会部署但会出现 404 错误。

【问题讨论】:

    标签: next.js graphcms


    【解决方案1】:

    我有这个完全相同的问题。我手动安装了 next.js

    • npm install next react react-dom

    https://nextjs.org/docs/getting-started

    并成功部署到 Vercel。

    【讨论】:

      猜你喜欢
      • 2022-01-02
      • 1970-01-01
      • 1970-01-01
      • 2019-10-04
      • 1970-01-01
      • 2022-12-30
      • 2022-06-11
      • 2020-12-24
      • 2019-02-24
      相关资源
      最近更新 更多