gpt4 book ai didi

node.js - 我部署了我的项目,我收到此错误输入文件包含不受支持的图像格式

转载 作者:行者123 更新时间:2023-12-04 14:48:56 24 4
gpt4 key购买 nike

我正在尝试在我的生产环境中构建(我使用 GitHub 操作进行部署),但错误是我本地的 Node 不一样

在我的本地我有这个版本:

npm -v
-> 7.24.1

node -v
-> v14.13.1

但我不知道GitHub actions上的node版本是多少我无法在本地重现错误,因为版本不一样

我收到这个错误:

success extract queries from components - 4.464s
success write out redirect data - 0.001s
success Build manifest and related icons - 0.003s
error "gatsby-plugin-manifest" threw an error while running the onPostBootstrap lifecycle:

Input file contains unsupported image format


Error:Input file contains unsupported image format

not finished onPostBootstrap - 0.025s
npm ERR! code ELIFECYCLE

这些是我的依赖项:

{
"dependencies": {
"@material-ui/core": "4.11.0",
"@material-ui/icons": "4.9.1",
"@material-ui/lab": "4.0.0-alpha.56",
"@material-ui/styles": "4.11.4",
"axios": "^0.21.0",
"file-saver": "^2.0.5",
"firebase": "^7.15.4",
"gatsby": "^2.22.15",
"gatsby-cli": "^2.12.87",
"gatsby-image": "^2.4.5",
"gatsby-plugin-manifest": "^2.4.9",
"gatsby-plugin-material-ui": "3.0.0",
"gatsby-plugin-react-helmet": "^3.3.2",
"gatsby-plugin-react-redux": "1.1.0",
"gatsby-plugin-react-svg": "^3.0.0",
"gatsby-plugin-robots-txt": "^1.6.8",
"gatsby-plugin-sharp": "^2.6.9",
"gatsby-plugin-sitemap": "3.3.0",
"gatsby-source-filesystem": "^2.3.8",
"gatsby-transformer-sharp": "2.5.3",
"material-ui-dropzone": "3.3.0",
"npm": "^7.5.6",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-redux": "^7.2.1",
"redux": "^4.0.5",
"redux-mock-store": "^1.5.4",
"stopword": "^1.0.3",
"tracking-number-validation": "^2.0.2",
"uuid": "^8.3.2"
},
}

这是要部署到生产环境的 build.yml

name: Build

on:
push:
branches:
- master

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- run: echo ${{ github.ref }}
- name: Checkout Repo
uses: actions/checkout@v2

最佳答案

but i dont know what is the node version on github actions i can not reproduce the error in my local, because of the version are not the same

您可以使用setup-node 操作使版本与您的本地版本完全相同:

- uses: actions/setup-node@v2
with:
node-version: '14.13.1'
- run: npm install -g npm@7.24.1
- run: npm -v
- run: node -v

github中的输出:

Run npm -v
npm -v
shell: /usr/bin/bash -e {0}
7.24.1
Run node -v
node -v
shell: /usr/bin/bash -e {0}
v14.13.1

关于node.js - 我部署了我的项目,我收到此错误输入文件包含不受支持的图像格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69400311/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com