我正在将我的第一个项目上传到
Netlify
,但遇到了一些问题。我一直在调试并修复了迄今为止遇到的所有问题,因为它们有错误消息,但我现在的情况是我的网站上传时间太长,而且它一开始就不是一个非常大的网站所以我不知道问题是什么。
12:13:18 AM: Netlify Build
12:13:18 AM: ────────────────────────────────────────────────────────────────
12:13:18 AM:
12:13:18 AM: ❯ Version
12:13:18 AM: @netlify/build 29.20.12
12:13:18 AM:
12:13:18 AM: ❯ Flags
12:13:18 AM: baseRelDir: true
12:13:18 AM: buildId: 64febdf8ece3553c9ec203d1
12:13:18 AM: deployId: 64febdf8ece3553c9ec203d3
12:13:18 AM:
12:13:18 AM: ❯ Current directory
12:13:18 AM: /opt/build/repo
12:13:18 AM:
12:13:18 AM: ❯ Config file
12:13:18 AM: /opt/build/repo/netlify.toml
12:13:18 AM:
12:13:18 AM: ❯ Context
12:13:18 AM: production
12:13:18 AM:
12:13:18 AM: build.command from netlify.toml
12:13:18 AM: ────────────────────────────────────────────────────────────────
12:13:18 AM:
12:13:18 AM: $ npm run dev
12:13:18 AM: > [email protected] dev
12:13:18 AM: > concurrently --kill-others npm run start npm run scss
12:13:18 AM: [0]
12:13:18 AM: [0] > [email protected] start
12:13:18 AM: [0] > nodemon ./bin/www
12:13:18 AM: [0]
12:13:18 AM: [1]
12:13:18 AM: [1] > [email protected] scss
12:13:18 AM: [1] > sass --watch src/scss/main.scss public/stylesheets/style.css
12:13:18 AM: [1]
12:13:18 AM: [0] [nodemon] 3.0.1
12:13:18 AM: [0] [nodemon] to restart at any time, enter `rs`
12:13:18 AM: [0] [nodemon] watching path(s): *.*
12:13:18 AM: [0] [nodemon] watching extensions: js,mjs,cjs,json
12:13:18 AM: [0] [nodemon] starting `node ./bin/www`
12:13:18 AM: [1] Sass is watching for changes. Press Ctrl-C to stop.
12:13:18 AM: [1]
12:31:25 AM: Execution timed out after 18m10.001708592s
12:31:25 AM: Error running command: Command did not finish within the time limit
12:31:25 AM: Failing build: Failed to build site
12:31:26 AM: Finished processing build request in 18m28.601s
我唯一能想到的是我的文件夹树和构建设置可能不正确。我有一个非常基本的文件夹结构。
├── bin
├── models
├── node_models
├── public
├── routes
├── src/scss
├── views
├── app.js
├── netlify.toml
├── package.json
├── package-lock.json
├── .gitignore
├── README.md
这是我的构建设置。
这也是我的
package.json
,其中列出了我的运行命令。
"scripts": {
"start": "nodemon ./bin/www",
"scss": "sass --watch src/scss/main.scss public/stylesheets/style.css",
"dev": "concurrently --kill-others \"npm run start\" \"npm run scss\""
},
@Andy 是正确的,由于我所假设的构建命令,我失败了。我找到了正确的修复方法,现在我的网站已上线。