我在将Gatsby网站部署到Netlify时遇到问题吗?

时间:2020-05-22 21:48:51

标签: node.js reactjs npm gatsby netlify

我从https://github.com/W#Layouts/gatsby-starter-delog拨出了Gatsby Starter Delog

我将其克隆到本地计算机中并进行了所需的更改。我将代码推送到github。

然后我在https://jatinrao.netlify.app/上浏览了我的网站

似乎没有进行任何更改。因此,我在netlify仪表板中触发了部署,但是发出了如下错误。

进行一些更改后,我尝试将我的Gatsby网站部署到Netlify!但是它发出了以下错误!

源代码:-[{https://github.com/jatin2003/gatsby-starter-blog][2]

3:02:50 AM: Build ready to start
3:02:52 AM: build-image version: 30f629161c0736b1a3ecd8b418e5eeffab5c0faf
3:02:52 AM: build-image tag: v3.3.14
3:02:52 AM: buildbot version: 80440c4491d323247b9d55f7bea2ea6bc96ce8d2
3:02:52 AM: Fetching cached dependencies
3:02:52 AM: Starting to download cache of 254.9KB
3:02:52 AM: Finished downloading cache in 82.800904ms
3:02:52 AM: Starting to extract cache
3:02:52 AM: Failed to fetch cache, continuing with build
3:02:52 AM: Starting to prepare the repo for build
3:02:53 AM: No cached dependencies found. Cloning fresh repo
3:02:53 AM: git clone git@github.com:jatin2003/gatsby-starter-blog
3:02:54 AM: Preparing Git Reference refs/heads/master
3:02:55 AM: Found Netlify configuration file netlify.toml in site root
3:02:55 AM: Found Netlify configuration file(s). Overriding site configuration
3:02:55 AM: Starting build script
3:02:55 AM: Installing dependencies
3:02:56 AM: Attempting node version '10' from .nvmrc
3:02:56 AM: v10.20.1 is already installed.
3:02:57 AM: Now using node v10.20.1 (npm v6.14.4)
3:02:57 AM: Started restoring cached build plugins
3:02:57 AM: Finished restoring cached build plugins
3:02:57 AM: Attempting ruby version 2.6.2, read from environment
3:02:59 AM: Using ruby version 2.6.2
3:02:59 AM: Using PHP version 5.6
3:02:59 AM: 5.2 is already installed.
3:02:59 AM: Using Swift version 5.2
3:02:59 AM: Started restoring cached node modules
3:02:59 AM: Finished restoring cached node modules
3:02:59 AM: Installing NPM modules using NPM version 6.14.4
3:03:12 AM: npm WARN
3:03:12 AM:  Invalid name: "Jatin Rao"
3:03:12 AM: npm WARN repo No description
3:03:12 AM: npm WARN repo No repository field.
3:03:12 AM: npm WARN repo No README data
3:03:12 AM: npm WARN repo No license field.
3:03:12 AM: added 37 packages from 27 contributors in 11.193s
3:03:12 AM: 12 packages are looking for funding
3:03:12 AM:   run `npm fund` for details
3:03:12 AM: found 0 vulnerabilities
3:03:12 AM: NPM modules installed
3:03:12 AM: Started restoring cached go cache
3:03:12 AM: Finished restoring cached go cache
3:03:12 AM: go version go1.12 linux/amd64
3:03:12 AM: go version go1.12 linux/amd64
3:03:12 AM: Installing missing commands
3:03:12 AM: Verify run directory
3:03:12 AM: Executing user command: npm run build
3:03:13 AM: npm
3:03:13 AM:  ERR! Invalid name: "Jatin Rao"
3:03:13 AM: npm ERR! A complete log of this run can be found in:
3:03:13 AM: npm ERR!     /opt/buildhome/.npm/_logs/2020-05-22T21_33_13_283Z-debug.log
3:03:13 AM: Skipping functions preparation step: no functions directory set
3:03:13 AM: Caching artifacts
3:03:13 AM: Started saving node modules
3:03:13 AM: Finished saving node modules
3:03:13 AM: Started saving build plugins
3:03:13 AM: Finished saving build plugins
3:03:13 AM: Started saving pip cache
3:03:20 AM: Finished saving pip cache
3:03:20 AM: Started saving emacs cask dependencies
3:03:20 AM: Finished saving emacs cask dependencies
3:03:20 AM: Started saving maven dependencies
3:03:20 AM: Finished saving maven dependencies
3:03:20 AM: Started saving boot dependencies
3:03:20 AM: Finished saving boot dependencies
3:03:20 AM: Started saving go dependencies
3:03:20 AM: Finished saving go dependencies
3:03:23 AM: Error running command: Build script returned non-zero exit code: 1
3:03:23 AM: Failing build: Failed to build site
3:03:23 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1
3:03:23 AM: Finished processing build request in 31.294226357s

任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:2)

错误显示ERR! Invalid name: "Jatin Rao" :软件包名称无效。

package.json的“名称”字段中不允许使用大写字母和空格。

根据此comment