Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Please set the GIT_USER environment variable! #3389

Closed
novoselovaleksandr opened this issue Sep 2, 2020 · 8 comments
Closed

Error: Please set the GIT_USER environment variable! #3389

novoselovaleksandr opened this issue Sep 2, 2020 · 8 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@novoselovaleksandr
Copy link

novoselovaleksandr commented Sep 2, 2020

🐛 Bug Report

I can not deploy my docusaurus site. I try:
cmd /C "set "GIT_USER=novoselovaleksandr" USE_SSH=true && yarn deploy"
and i get an error:
image
This is a part of my docusaurus.config.js
image
what am I doing wrong?

my repository

@novoselovaleksandr novoselovaleksandr added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Sep 2, 2020
@slorber
Copy link
Collaborator

slorber commented Sep 2, 2020

Hi,

I don't know enough about windows nor have a windows computer to test this, but maybe you could try to use echo % GIT_USER% or something in the command to verify that the env variable is set correctly?

I guess the syntax may also depend on the Windows kind of shell you use.

You'd rather ask for help to the community on discord, I'm pretty sure you'll find someone that is able to deploy from Windows here

@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label Sep 2, 2020
@jeremyhager
Copy link
Contributor

I've had a similar issue before where I needed to change the quotes - so for your example you may need to do the following:

cmd /C "set 'GIT_USER=novoselovaleksandr' USE_SSH=true && yarn deploy"
Notice the single quotes vs. double.

I will say I just ran cmd /C "set "GIT_USER=jeremyhager" && yarn deploy" within command prompt and it seemed to work just fine. However PowerShell will treat quotes differently, which is how I am assuming this is being deployed in your environment:
image

The differences here are that PowerShell sees the quotes in "set " as the command to run, but when switching for single-quotes PowerShell now recognizes the full command. Perhaps working on a request to update the Windows documentation is in order.

@slorber
Copy link
Collaborator

slorber commented Sep 4, 2020

Thanks, can you try again with simple quotes @novoselovaleksandr ?

Also, any help to improve windows doc is welcome ;)

@arifszn
Copy link
Contributor

arifszn commented Sep 16, 2020

Faced same error. Switching to window's default cmd worked.

@lex111
Copy link
Contributor

lex111 commented Sep 19, 2020

Resolved in #3459

@lex111 lex111 closed this as completed Sep 19, 2020
@talkohavy
Copy link

This also happened to me on Macos, so I can confirm it's not a Windows thing.

@Riversruntothesea
Copy link

配置环境变量
GIT_USER
值是你的GitHub名称

@ajay-dhangar
Copy link

I'm also facing this issue

PS F:\personal-sites\code-harbor-hub> npm run deploy

> code-harbor-hub@0.0.0 deploy
> docusaurus deploy

[WARNING] When deploying to GitHub Pages, it is better to use an explicit "trailingSlash" site config.
Otherwise, GitHub Pages will add an extra trailing slash to your site urls only on direct-access (not when navigation) with a server redirect.
This behavior can have SEO impacts and create relative link issues.

[INFO] Deploy command invoked...

Error: Please set the GIT_USER environment variable, or explicitly specify USE_SSH instead!
    at Command.deploy (F:\personal-sites\code-harbor-hub\node_modules\@docusaurus\core\lib\commands\deploy.js:70:19)

[INFO] Docusaurus version: 3.1.1
Node version: v20.10.0
PS F:\personal-sites\code-harbor-hub> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

No branches or pull requests

8 participants