首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Nextjs:我如何构建下一个应用程序并将其部署到netlify?

Nextjs:我如何构建下一个应用程序并将其部署到netlify?
EN

Stack Overflow用户
提问于 2022-08-12 18:43:27
回答 1查看 65关注 0票数 0

文件夹结构:

我从事Web3.0项目的工作。现在我想向我的老板展示一个演示,我正在尝试创建这个构建并上传到Netlify。运行纱线运行生成会导致错误。我是next.js的新手,不能解决这个问题。如果你能的话,请帮帮我。

代码语言:javascript
复制
 yarn run v1.22.19
    $ next build
    Browserslist: caniuse-lite is outdated. Please run:
    npx browserslist@latest --update-db
    
    Why you should do it regularly:
    https://github.com/browserslist/browserslist#browsers-data-updating
    info  - Checking validity of types
    Browserslist: caniuse-lite is outdated. Please run:
    npx browserslist@latest --update-db
    
    Why you should do it regularly:
    https://github.com/browserslist/browserslist#browsers-data-updating
    
    Failed to compile.

   //  Warnings and errors 

info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Package.json:

代码语言:javascript
复制
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },

.eslintrc.json:

代码语言:javascript
复制
{
  "extends": "next/core-web-vitals"
}
EN

回答 1

Stack Overflow用户

发布于 2022-08-12 23:40:39

在项目路径中,运行以下命令:

代码语言:javascript
复制
npx browserslist@latest --update-db

或者,不建议更改您的.eslintrc.json

代码语言:javascript
复制
{
  "extends": "next",
  "rules": {
    "react/no-unescaped-entities": "off",
    "@next/next/no-page-custom-font": "off"
  }
}
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73338523

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档