簡體   English   中英

為什么在build next.js項目的時候會報錯?

[英]Why is there an error during build next.js project?

**我的 node.js.yml 文件 **


name: Node.js CI

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [14.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
    - uses: actions/checkout@v3
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
    - run: npm ci
    - run: npm run build
    - run: npm run export
    
    - name: Deploy 🚀
      uses: JamesIves/github-pages-deploy-action@v4
      with:
          branch: gh-pages
          folder: out # The folder the action should deploy.

在此處輸入圖片描述錯誤

鏈接到我的存儲庫https://github.com/EduardKop/web-cv-next

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,
  distDir: 'build',
  images: {
    loader: 'akamai',
    path: '',
  }
  
}

module.exports = nextConfig

我寫了 next.config.js 配置。 我做了一個提交,然后在 yaml 文件中設置了上面指示的操作並得到了一個錯誤

你應該給出圖像的路徑,錯誤的說路徑不能小於 0 個字符。

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  swcMinify: true,
  distDir: 'build',
  images: {
    loader: 'akamai',
    path: '',
  }
  
}

module.exports = nextConfig

您應該在路徑屬性中寫入路徑。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM