【发布时间】:2021-07-27 07:53:10
【问题描述】:
我一直在想这个
我已使用 this 视频作为参考,但我仍然收到以下错误
我已经尝试了从Netlify Form 到youtube 和Stackoverflow 的所有方法
5:33:23 AM: ────────────────────────────────────────────────────────────────
5:33:23 AM: "build.command" failed
5:33:23 AM: ────────────────────────────────────────────────────────────────
5:33:23 AM:
5:33:23 AM: Error message
5:33:23 AM: Command failed with exit code 1: CI= npm run build
5:33:23 AM:
5:33:23 AM: Error location
5:33:23 AM: In Build command from Netlify app:
5:33:23 AM: CI= npm run build
5:33:23 AM:
5:33:23 AM: Resolved config
5:33:23 AM: build:
5:33:23 AM: command: CI= npm run build
5:33:23 AM: commandOrigin: ui
5:33:23 AM: publish: /opt/build/repo/dist
我的 package.json 文件
{
"name": "testing",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "./node_modules/.bin/netlify-lambda serve src",
"build": "CI= npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/<my-username>/testing.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/<my-username>/testing/issues"
},
"homepage": "https://github.com/<my-username>/testing#readme",
"dependencies": {
"express": "^4.17.1",
"netlify-lambda": "^2.0.6",
"serverless-http": "^2.7.0"
}
}
我的 netlify.toml
[build]
functions = "functions"
我错过了什么?请帮助我为此失去头发
【问题讨论】:
-
我认为这个 "build": "CI= npm run build" 应该只是 "build": "npm run build"
-
@taleodor 仍然无法正常工作,您是否有一个简单的 hello world 存储库以便我可以参考?
-
不,抱歉,没试过 Netflify。如果您愿意尝试 Google App Engine + GitHub Actions 组合 - 这是我的详细文章 - worklifenotes.com/2020/05/24/…
标签: node.js express deployment netlify