- 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/
我正在尝试使用 Spark 从 Cassandra 读取数据。 DataFrame rdf = sqlContext.read().option("keyspace", "readypulse
这是代码: void i_log_ (int error, const char * file, int line, const char * fmt, ...) { /* Get erro
我必须调试一个严重依赖 Gtk 的程序。问题是由于某些原因,在使用 GtkWindow 对象时开始出现许多运行时警告。问题是,即使 Gtk 提示严重错误,它也不会因这些错误而中止。我没有代码库的更改历
我正在尝试从已有效编译和链接的程序中检索二进制文件。我已经通过 GL_PROGRAM_BINARY_LENGTH 收到了它的长度。该文档说有两个实例可能会发生 GL_INVALID_OPERATION
我有一个托管在 Azure 环境中的服务。我正在使用控制台应用程序使用该服务。这样做时,我得到了异常: "The requested service, 'http://xxxx-d.yyyy.be/S
我有以下代码,它被 SEGV 信号杀死。使用调试器表明它被 main() 中的第一个 sem_init() 杀死。如果我注释掉第一个 sem_init() ,第二个会导致同样的问题。我试图弄清楚是什么
目前我正在编写一个应用程序(目标 iOS 6,启用 ARC),它使用 JSON 进行数据传输,使用核心数据进行持久存储。 JSON 数据由 PHP 脚本通过 json_encode 从 MySQL 数
我对 Xamarin.Forms 还是很陌生。我在出现的主页上有一个非常简单的功能 async public Task BaseAppearing() { if (UserID
这是我的代码的简化版本。 public class MainActivity extends ActionBarActivity { private ArrayList entry = new Arr
我想弄明白为什么我的两个 Java 库很难很好地协同工作。这是场景: 库 1 有一个类 A,其构造函数如下: public A(Object obj) { /* boilerplate */ } 在以
如果网站不需要身份验证,我的代码可以正常工作,如果需要,则在打印“已创建凭据”后会立即出现 EXC_BAD_ACCESS 错误。我不会发布任何内容,并且此代码是直接从文档中复制的 - 知道出了什么问题
我在使用 NSArray 填充 UITableView 时遇到问题。我确信我正在做一些愚蠢的事情,但我无法弄清楚。当我尝试进行简单的计数时,我得到了 EXC_BAD_ACCESS,我知道这是因为我试图
我在 UITableViewCell 上有一个 UITextField,在另一个单元格上有一个按钮。 我单击 UITextField(出现键盘)。 UITextField 调用了以下方法: - (BO
我有一个应用程序出现间歇性崩溃。崩溃日志显示了一个堆栈跟踪,这对我来说很难破译,因此希望其他人看到了这一点并能为我指出正确的方向。 基本上,应用程序在启动时执行反向地理编码请求,以在标签中显示用户的位
我开发了一个 CGImage,当程序使用以下命令将其显示在屏幕上时它工作正常: [output_view.layer performSelectorOnMainThread:@selector(set
我正在使用新的 EncryptedSharedPreferences以谷歌推荐的方式上课: private fun securePrefs(context: Context): SharedPrefe
我有一个中继器,里面有一些控件,其中一个是文本框。我正在尝试使用 jquery 获取文本框,我的代码如下所示: $("#").click(function (event) {}); 但我总是得到 nu
在以下场景中观察到 TTS 初始化错误,太随机了。 已安装 TTS 引擎,存在语音集,并且可以从辅助功能选项中播放示例 tts。 TTS 初始化在之前初始化和播放的同一设备上随机失败。 在不同的设备(
maven pom.xml org.openjdk.jol jol-core 0.10 Java 类: public class MyObjectData { pr
在不担心冲突的情况下,可以使用 MD5 作为哈希值,字符串长度最多为多少? 这可能是通过为特定字符集中的每个可能的字符串生成 MD5 哈希来计算的,长度不断增加,直到哈希第二次出现(冲突)。没有冲突的
我是一名优秀的程序员,十分优秀!