- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试部署我的 nextjs 应用程序 netlify,但它一直向我抛出失败错误,没有部署这是我的 github 存储库 https://github.com/farishelmipermana/nextjs-portfolio.git ,我正在尝试通过更改 yarn build && next export
来修复,我遇到了问题 Cannot deploy Next.js to Netlify。由于@netlify/plugin-nextjs 插件错误导致部署失败
这是我的日志
12:10:08 PM: Build ready to start
12:10:11 PM: build-image version: a49edbc55fc722f80f6b85963a5060f8d043a844 (focal)
12:10:11 PM: build-image tag: v4.8.1
12:10:11 PM: buildbot version: 4d0ac5fd74188fe527fa2a661368485be00b8be6
12:10:12 PM: Fetching cached dependencies
12:10:12 PM: Failed to fetch cache, continuing with build
12:10:12 PM: Starting to prepare the repo for build
12:10:12 PM: No cached dependencies found. Cloning fresh repo
12:10:12 PM: git clone https://github.com/farishelmipermana/nextjs-portfolio
12:10:12 PM: Preparing Git Reference refs/heads/master
12:10:13 PM: Parsing package.json dependencies
12:10:14 PM: Starting build script
12:10:14 PM: Installing dependencies
12:10:14 PM: Python version set to 2.7
12:10:14 PM: v16.15.1 is already installed.
12:10:15 PM: Now using node v16.15.1 (npm v8.11.0)
12:10:15 PM: Started restoring cached build plugins
12:10:15 PM: Finished restoring cached build plugins
12:10:15 PM: Attempting ruby version 2.7.2, read from environment
12:10:16 PM: Using ruby version 2.7.2
12:10:16 PM: Using PHP version 8.0
12:10:16 PM: Started restoring cached yarn cache
12:10:16 PM: Finished restoring cached yarn cache
12:10:17 PM: No yarn workspaces detected
12:10:17 PM: Started restoring cached node modules
12:10:17 PM: Finished restoring cached node modules
12:10:17 PM: Installing NPM modules using Yarn version 1.22.10
12:10:17 PM: npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
12:10:17 PM: npm WARN config location in the cache, and they are managed by
12:10:17 PM: npm WARN config [`cacache`](http://npm.im/cacache).
12:10:17 PM: yarn install v1.22.10
12:10:18 PM: warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
12:10:18 PM: [1/4] Resolving packages...
12:10:18 PM: [2/4] Fetching packages...
12:10:25 PM: info @next/swc-win32-x64-msvc@12.1.6: The platform "linux" is incompatible with this module.
12:10:25 PM: info "@next/swc-win32-x64-msvc@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
12:10:25 PM: info @next/swc-android-arm64@12.1.6: The platform "linux" is incompatible with this module.
12:10:25 PM: info "@next/swc-android-arm64@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
12:10:25 PM: info @next/swc-android-arm64@12.1.6: The CPU architecture "x64" is incompatible with this module.
12:10:25 PM: info @next/swc-android-arm-eabi@12.1.6: The platform "linux" is incompatible with this module.
12:10:25 PM: info "@next/swc-android-arm-eabi@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
12:10:25 PM: info @next/swc-android-arm-eabi@12.1.6: The CPU architecture "x64" is incompatible with this module.
12:10:25 PM: info @next/swc-darwin-arm64@12.1.6: The platform "linux" is incompatible with this module.
12:10:25 PM: info "@next/swc-darwin-arm64@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
12:10:25 PM: info @next/swc-darwin-arm64@12.1.6: The CPU architecture "x64" is incompatible with this module.
12:10:25 PM: info @next/swc-linux-arm-gnueabihf@12.1.6: The CPU architecture "x64" is incompatible with this module.
12:10:25 PM: info "@next/swc-linux-arm-gnueabihf@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
12:10:25 PM: info @next/swc-linux-arm64-gnu@12.1.6: The CPU architecture "x64" is incompatible with this module.
12:10:25 PM: info "@next/swc-linux-arm64-gnu@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
12:10:25 PM: info @next/swc-darwin-x64@12.1.6: The platform "linux" is incompatible with this module.
12:10:25 PM: info "@next/swc-darwin-x64@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
12:10:25 PM: info @next/swc-win32-ia32-msvc@12.1.6: The platform "linux" is incompatible with this module.
12:10:25 PM: info "@next/swc-win32-ia32-msvc@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
12:10:25 PM: info @next/swc-win32-ia32-msvc@12.1.6: The CPU architecture "x64" is incompatible with this module.
12:10:25 PM: info @next/swc-win32-arm64-msvc@12.1.6: The platform "linux" is incompatible with this module.
12:10:25 PM: info "@next/swc-win32-arm64-msvc@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
12:10:25 PM: info @next/swc-win32-arm64-msvc@12.1.6: The CPU architecture "x64" is incompatible with this module.
12:10:25 PM: info @next/swc-linux-arm64-musl@12.1.6: The CPU architecture "x64" is incompatible with this module.
12:10:25 PM: info "@next/swc-linux-arm64-musl@12.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
12:10:25 PM: info fsevents@2.3.2: The platform "linux" is incompatible with this module.
12:10:25 PM: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
12:10:25 PM: [3/4] Linking dependencies...
12:10:25 PM: [4/4] Building fresh packages...
12:10:25 PM: success Saved lockfile.
12:10:25 PM: Done in 8.02s.
12:10:25 PM: NPM modules installed using Yarn
12:10:26 PM: Started restoring cached go cache
12:10:26 PM: Finished restoring cached go cache
12:10:26 PM: Installing Go version 1.17 (requested 1.17)
12:10:31 PM: unset GOOS;
12:10:31 PM: unset GOARCH;
12:10:31 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.17.linux.amd64';
12:10:31 PM: export PATH="/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}";
12:10:31 PM: go version >&2;
12:10:31 PM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.17.linux.amd64.env"
12:10:31 PM: go version go1.17 linux/amd64
12:10:31 PM: Installing missing commands
12:10:31 PM: Verify run directory
12:10:33 PM:
12:10:33 PM: ────────────────────────────────────────────────────────────────
12:10:33 PM: Netlify Build
12:10:33 PM: ────────────────────────────────────────────────────────────────
12:10:33 PM:
12:10:33 PM: ❯ Version
12:10:33 PM: @netlify/build 27.1.6
12:10:33 PM:
12:10:33 PM: ❯ Flags
12:10:33 PM: baseRelDir: true
12:10:33 PM: buildId: 62b3f5b0d3c7f33c0246be8c
12:10:33 PM: deployId: 62b3f5b0d3c7f33c0246be8e
12:10:33 PM:
12:10:33 PM: ❯ Current directory
12:10:33 PM: /opt/build/repo
12:10:33 PM:
12:10:33 PM: ❯ Config file
12:10:33 PM: No config file was defined: using default values.
12:10:33 PM:
12:10:33 PM: ❯ Context
12:10:33 PM: production
12:10:33 PM:
12:10:33 PM: ❯ Installing plugins
12:10:33 PM: - @netlify/plugin-nextjs@4.9.1
12:10:43 PM:
12:10:43 PM: ❯ Loading plugins
12:10:43 PM: - @netlify/plugin-nextjs@4.9.1 from Netlify app
12:10:45 PM:
12:10:45 PM: ────────────────────────────────────────────────────────────────
12:10:45 PM: 1. @netlify/plugin-nextjs (onPreBuild event)
12:10:45 PM: ────────────────────────────────────────────────────────────────
12:10:45 PM:
12:10:45 PM: No Next.js cache to restore.
12:10:45 PM: Netlify configuration property "build.environment.NEXT_PRIVATE_TARGET" value changed.
12:10:45 PM:
12:10:45 PM: (@netlify/plugin-nextjs onPreBuild completed in 24ms)
12:10:45 PM:
12:10:45 PM: ────────────────────────────────────────────────────────────────
12:10:45 PM: 2. Build command from Netlify app
12:10:45 PM: ────────────────────────────────────────────────────────────────
12:10:45 PM:
12:10:45 PM: $ yarn build && next export
12:10:45 PM: yarn run v1.22.10
12:10:45 PM: $ next build
12:10:46 PM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
12:10:46 PM: info - Checking validity of types...
12:10:46 PM: warn - No ESLint configuration detected. Run next lint to begin setup
12:10:46 PM: info - Creating an optimized production build...
12:10:59 PM: info - Compiled successfully
12:10:59 PM: info - Collecting page data...
12:11:02 PM: info - Generating static pages (0/6)
12:11:02 PM: info - Generating static pages (1/6)
12:11:02 PM: info - Generating static pages (2/6)
12:11:02 PM: info - Generating static pages (4/6)
12:11:02 PM: info - Generating static pages (6/6)
12:11:03 PM: info - Finalizing page optimization...
12:11:03 PM: Page Size First Load JS
12:11:03 PM: ┌ ○ / 1.86 kB 79.5 kB
12:11:03 PM: ├ /_app 0 B 75.2 kB
12:11:03 PM: ├ ○ /404 193 B 75.4 kB
12:11:03 PM: ├ ○ /about 813 B 78.4 kB
12:11:03 PM: ├ ○ /contact 728 B 78.3 kB
12:11:03 PM: └ ○ /portfolio 747 B 78.4 kB
12:11:03 PM: + First Load JS shared by all 75.2 kB
12:11:03 PM: ├ chunks/framework-4556c45dd113b893.js 45.2 kB
12:11:03 PM: ├ chunks/main-d8b1ff545a609496.js 28.6 kB
12:11:03 PM: ├ chunks/pages/_app-fb3a3036b08bee65.js 508 B
12:11:03 PM: ├ chunks/webpack-69bfa6990bb9e155.js 769 B
12:11:03 PM: └ css/2ab3fddc65372c75.css 752 B
12:11:03 PM: ○ (Static) automatically rendered as static HTML (uses no initial props)
12:11:03 PM: Done in 17.71s.
12:11:03 PM: info - using build directory: /opt/build/repo/.next
12:11:03 PM: info - Copying "static build" directory
12:11:03 PM: info - No "exportPathMap" found in "undefined". Generating map from "./pages"
12:11:03 PM: info - Launching 7 workers
12:11:03 PM: info - Exporting (0/5)
12:11:03 PM: info - Copying "public" directory
12:11:04 PM: info - Exporting (1/5)
12:11:04 PM: info - Exporting (2/5)
12:11:04 PM: info - Exporting (3/5)
12:11:04 PM: info - Exporting (5/5)
12:11:04 PM: Export successful. Files written to /opt/build/repo/out
12:11:04 PM:
12:11:04 PM: (build.command completed in 19.4s)
12:11:04 PM:
12:11:04 PM: ────────────────────────────────────────────────────────────────
12:11:04 PM: 3. @netlify/plugin-nextjs (onBuild event)
12:11:04 PM: ────────────────────────────────────────────────────────────────
12:11:04 PM:
12:11:04 PM:
12:11:04 PM: ────────────────────────────────────────────────────────────────
12:11:04 PM: Plugin "@netlify/plugin-nextjs" failed
12:11:04 PM: ────────────────────────────────────────────────────────────────
12:11:04 PM:
12:11:04 PM: Error message
12:11:04 PM: Error: The directory "/opt/build/repo/out" does not contain a Next.js production build. Perhaps the build command was not run, or you specified the wrong publish directory.
12:11:04 PM: Your publish directory is set to "out", but in most cases it should be ".next".
12:11:04 PM: If you are using "next export" then you should set the environment variable NETLIFY_NEXT_PLUGIN_SKIP to "true".
12:11:04 PM:
12:11:04 PM: Plugin details
12:11:04 PM: Package: @netlify/plugin-nextjs
12:11:04 PM: Version: 4.9.1
12:11:04 PM: Repository: git+https://github.com/netlify/netlify-plugin-nextjs.git
12:11:04 PM: npm link: https://www.npmjs.com/package/@netlify/plugin-nextjs
12:11:04 PM: Report issues: https://github.com/netlify/netlify-plugin-nextjs/issues
12:11:04 PM:
12:11:04 PM: Error location
12:11:04 PM: In "onBuild" event in "@netlify/plugin-nextjs" from Netlify app
12:11:04 PM: at checkNextSiteHasBuilt (/.netlify/plugins/node_modules/@netlify/plugin-nextjs/lib/helpers/verification.js:72:16)
12:11:04 PM: at onBuild (/.netlify/plugins/node_modules/@netlify/plugin-nextjs/lib/index.js:41:50)
12:11:04 PM:
12:11:04 PM: Resolved config
12:11:04 PM: build:
12:11:04 PM: command: yarn build && next export
12:11:04 PM: commandOrigin: ui
12:11:04 PM: environment:
12:11:04 PM: - NEXT_PRIVATE_TARGET
12:11:04 PM: publish: /opt/build/repo/out
12:11:04 PM: publishOrigin: ui
12:11:04 PM: plugins:
12:11:04 PM: - inputs: {}
12:11:04 PM: origin: ui
12:11:04 PM: package: '@netlify/plugin-nextjs'
12:11:05 PM: Caching artifacts
12:11:05 PM: Started saving node modules
12:11:05 PM: Finished saving node modules
12:11:05 PM: Started saving build plugins
12:11:05 PM: Finished saving build plugins
12:11:05 PM: Started saving yarn cache
12:11:05 PM: Finished saving yarn cache
12:11:05 PM: Started saving pip cache
12:11:05 PM: Finished saving pip cache
12:11:05 PM: Started saving emacs cask dependencies
12:11:05 PM: Finished saving emacs cask dependencies
12:11:05 PM: Started saving maven dependencies
12:11:05 PM: Finished saving maven dependencies
12:11:05 PM: Started saving boot dependencies
12:11:05 PM: Finished saving boot dependencies
12:11:05 PM: Started saving rust rustup cache
12:11:05 PM: Finished saving rust rustup cache
12:11:05 PM: Started saving go dependencies
12:11:05 PM: Finished saving go dependencies
12:11:07 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:11:07 PM: Creating deploy upload records
12:11:07 PM: Failing build: Failed to build site
12:11:07 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
12:11:07 PM: Finished processing build request in 55.750494271s
我已经尝试将公共(public)目录设置为out
,但我仍然收到类似这样的错误Cannot deploy Next.js to Netlify。由于@netlify/plugin-nextjs 插件错误导致部署失败
我也删除了 netlify 中的所有插件,但仍然出现这样的错误 Cannot deploy Next.js to Netlify。由于@netlify/plugin-nextjs 插件错误导致部署失败
谢谢你的帮助
最佳答案
TL;DR:您需要在 Netlify UI 中添加值为 true
的 NETLIFY_NEXT_PLUGIN_SKIP
环境变量。然后,您可以将发布目录设置为 out
,这样就可以了。
根据您的构建命令,您正在使用 Next.js 的静态导出功能。这需要在 Netlify 上进行特殊配置,如下所述:https://github.com/netlify/netlify-plugin-nextjs#use-with-next-export
关于reactjs - 我无法将 Next.js 部署到 Netlify。由于@netlify/plugin-nextjs 插件错误导致部署失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72724257/
尝试熟悉 Maven 并参加在线类(class),但陷入困境......感谢提供的任何帮助。 我正在运行站点阶段,虽然它已完成并且我能够在浏览器中实际查看index.html,但我在此过程中遇到了很多
基本上就是标题。。我在任何地方都找不到一个简单的比较,来解释这两者之间的差异:。我知道Gradle中可以有3种类型的插件:。我认为这三种类型的插件在某种程度上与它们可以在settings.gradle
我是 maven 的初学者,现在我对这些 maven 插件之间的区别感到困惑。这些都是创建jar文件吗?现在我的问题是 各个插件创建的jar有什么区别。(组装插件、jar-plugin、shaded插
我使用 tycho-packaging-plugin 来设置 jar 的输出文件夹。这是我的 pom 的缩短版本: 0.21.0 org.eclipse.
When starting the server, refuses to load my plugin with an error:启动服务器时,拒绝加载我的插件,并出现错误: Could n
为什么卸载以下(空)插件会导致错误? 这是my-plugin/my-plugin.php : : my-plugin 关于wordpress - 由于错误 : Could not fully remo
我使用 sbt 与 playframework 和 activator 来构建一个 Web 应用程序。我的 sbt 版本是 0.13.0 我将plugin.sbt 文件更改为: logLevel :=
这是我运行 atlas-create-jira-plugin 时得到的结果后跟 atlas-create-jira-plugin-module选择选项1: Component Import . 问题是
我正在尝试使用 Maven 构建我的 Java 项目,但它失败了,并且出现以下错误: 从存储库 [local (C:\Users\Vinita.Gupta.m2\repository), centra
我正在使用 eclipse mars-2。我想在 Windows 中创建一个新的 Maven Spring Boot 项目。但我遇到了类似 的错误 Could not calculate build
最近开发的产品,我们是有四五个maven模块,开发阶段一直是在eclipse中运行的,然后快发版的时候,需要把这些项目打成jar包,通过命令去启动,那首先就得把这些模块项目打包,或者拷贝一些资源文件等
我想使用 maven-resources-plugin 复制 Excel 并使用 exec-maven-plugin 从该 Excel 创建一些属性文件。并且新创建的属性需要附加到构建中。我可以创建属
当我尝试构建项目时出现此错误。 Errors occurred during the build. Errors running builder 'Maven Project Builder' on
当我在执行 Maven 时从 eclipse 内部 -> 更新项目我遇到以下问题 Unable to update Maven configuration Could not calculate bu
我之前问过一个关于延迟处理事件的问题:Grails non time based queuing .我开始使用 rabbitmq 插件:http://grails.org/plugin/rabbitm
我正在尝试使用 maven 构建一个 java spring 项目(来自 heroku 入门指南的默认项目)。出于某种原因,我不断收到以下错误。机器上网应该没有问题。 Failed to execut
操作系统:OSX 10.11 Cordova :5.4.1(也尝试过 6.0)节点:4.2.6使用的cordova插件:crosswalk-project/cordova-plugin-crosswa
org.sonatype.maven.plugin :emma-maven-plugin:1.2 org.codehaus.mojo :emma-maven-plugin:1.0-alpha-3 or
我正在管理安装了很多插件的多个 shopware 6 商店。后端只允许更新一个插件,这非常耗时,因为更新分两步完成: 更新已加载(加载器圈) 后端已重新加载(html 重新加载) 为什么没有“更新所有
我正在管理安装了很多插件的多个 shopware 6 商店。后端只允许更新一个插件,这非常耗时,因为更新分两步完成: 更新已加载(加载器圈) 后端已重新加载(html 重新加载) 为什么没有“更新所有
我是一名优秀的程序员,十分优秀!