Gatsby SSG template build error

Summary

It's not #220680 (closed)

I change pathPrefix in gatsby-config.js after project create from Gatsby template.

Build stopped with error:

npm info lifecycle gatsby-cli@2.14.1~postinstall: gatsby-cli@2.14.1
> gatsby-cli@2.14.1 postinstall /builds/schudakov/blog/node_modules/gatsby-cli
> node scripts/postinstall.js
/builds/schudakov/blog/node_modules/gatsby-cli/node_modules/chalk/source/index.js:106
	...styles,
	^^^
SyntaxError: Unexpected token ...
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/builds/schudakov/blog/node_modules/gatsby-cli/scripts/postinstall.js:1:77)
    at Module._compile (module.js:570:32)
npm info lifecycle gatsby-cli@2.14.1~postinstall: Failed to exec postinstall script
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/gatsby-recipes/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN ws@7.4.0 requires a peer of bufferutil@^4.0.1 but none was installed.
npm WARN ws@7.4.0 requires a peer of utf-8-validate@^5.0.2 but none was installed.
npm WARN friendly-errors-webpack-plugin@1.7.0 requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none was installed.
npm WARN ws@7.4.0 requires a peer of bufferutil@^4.0.1 but none was installed.
npm WARN ws@7.4.0 requires a peer of utf-8-validate@^5.0.2 but none was installed.
npm WARN @graphql-tools/schema@7.1.0 requires a peer of graphql@^14.0.0 || ^15.0.0 but none was installed.
npm WARN @graphql-tools/utils@7.1.0 requires a peer of graphql@^14.0.0 || ^15.0.0 but none was installed.
npm WARN graphql-compose@6.3.8 requires a peer of graphql@>=0.13.0 || >=14.0.0 || >=14.1.0 but none was installed.
npm WARN @turist/fetch@7.1.7 requires a peer of node-fetch@2 but none was installed.
npm WARN gatsby-starter-default@1.0.0 No repository field.
npm ERR! Linux 4.19.78-coreos
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "gatsby-cli"
npm ERR! node v6.10.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! gatsby-cli@2.14.1 postinstall: `node scripts/postinstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the gatsby-cli@2.14.1 postinstall script 'node scripts/postinstall.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the gatsby-cli package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node scripts/postinstall.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs gatsby-cli
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls gatsby-cli
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /builds/schudakov/blog/npm-debug.log
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1

Also when I try import project to Gatsby cloud I have error message:

Gatsby package version found in repo is incompatible with Gatsby Cloud
We have detected the Gatsby package version in the selected repository is incompatible with Gatsby Cloud.
Please upgrade your package to version 2.1.0 or above.
If you are sure that you got everything configured correctly, please contact our support — we are happy to help however we can!
If you need assistance, please email support at support@gatsbyjs.com.

Steps to reproduce

  1. Create project from template Pages/Gatsby
  2. Fix pathPrefix in gatsby-config.js to project slug
  3. Run pipeline
  4. Build error

Example Project

https://gitlab.com/schudakov/blog/-/jobs/879325343

What is the current bug behavior?

Can't build GitLab Pages

What is the expected correct behavior?

Build Gatsby without errors.

Output of checks

This bug happens on GitLab.com

Assignee Loading
Time tracking Loading