vue.js 生成已终止:生成脚本返回了非零退出代码:1

7y4bm7vi  于 2022-11-25  发布在  Vue.js
关注(0)|答案(2)|浏览(188)

我试图在Netlify上部署我的Vue应用程序,但出现了此错误,这里是日志,尝试在Stackoverflow上阅读其他答案,但仍然没有任何效果。
下面是日志https://pastebin.com/gt0xMhaG
此处为package.json

{
  "name": "invoice",
  "version": "0.1.0",
  "engines": {
    "node": "14.15.4"
  },
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "core-js": "^3.6.5",
    "firebase": "^9.0.1",
    "uid": "^2.0.0",
    "vue": "^3.0.11",
    "vue-router": "^4.0.0-0",
    "vuex": "^4.0.0-0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-plugin-router": "~4.5.0",
    "@vue/cli-plugin-vuex": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/compiler-sfc": "^3.0.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^7.0.0",
    "node-sass": "^4.12.0",
    "sass-loader": "^8.0.2"
  }
}
g52tjvyc

g52tjvyc1#

从你的日志看,你的运行时环境使用的是节点v16.13.0。这个错误是关于node-sass的,它在使用节点v16^时有问题。所以你的错误是在构建时触发的。阅读此线程
https://github.com/sass/node-sass/issues/3103
您可能需要在运行时环境中使用类似于节点14的程序包,或者转移到其他sass程序包(如dart-sass

11:09:31 PM: Build ready to start
11:09:33 PM: build-image version: 8925038cf853b22d6397cdcb9904ac88b66bb383 (focal)
11:09:33 PM: build-image tag: v4.5.0
11:09:33 PM: buildbot version: 26b97d2791a6a6b761b2a82710f290ed779fac72
11:09:33 PM: Fetching cached dependencies
11:09:33 PM: Failed to fetch cache, continuing with build
11:09:33 PM: Starting to prepare the repo for build
11:09:33 PM: No cached dependencies found. Cloning fresh repo
11:09:33 PM: git clone https://github.com/utkzas/digital-bill-book
11:09:34 PM: Preparing Git Reference refs/heads/main
11:09:35 PM: Parsing package.json dependencies
11:09:35 PM: Starting build script
11:09:35 PM: Installing dependencies
11:09:35 PM: Python version set to 2.7
11:09:36 PM: v16.13.0 is already installed.
11:09:36 PM: Now using node v16.13.0 (npm v8.1.0) <----- see this
shyt4zoc

shyt4zoc2#

检查是否已将package-lock.json文件提交到代码存储库。如果已提交,请将其从存储库中删除,然后在找到package-lock.json时再次触发deploy。Netlify构建文件

相关问题