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

Cannot install if user folder contain spaces on Windows. #1217

Closed
Xarkam opened this issue Feb 1, 2019 · 12 comments
Closed

Cannot install if user folder contain spaces on Windows. #1217

Xarkam opened this issue Feb 1, 2019 · 12 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution status: needs more information There is not enough information to take action on the issue.

Comments

@Xarkam
Copy link

Xarkam commented Feb 1, 2019

🐛 Bug Report

In accordance with documentation, npx docusaurus-init cannot install in my windows user folder because, I have spaces in name.

I discovered this after analyzing installation log.

info using [email protected]
info using [email protected]
silly fetchPackageMetaData error for file:Xarkam\AppData\Roaming\npm-cache\_npx\8596 Could not install from "Xarkam\AppData\Roaming\npm-cache\_npx\8596" as it does not contain a package.json file.
verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "docusaurus-init@latest" "--global" "--prefix" "C:\\Users\\Xarkam" "Xarkam\\AppData\\Roaming\\npm-cache\\_npx\\8596" "--loglevel" "error" "--json"
error Could not install from "Xarkam\AppData\Roaming\npm-cache\_npx\8596" as it does not contain a package.json file.

The correct path is "C:\\Users\\Xarkam Xarkam\\AppData\\Roaming\\npm-cache\\_npx\\8596" but the cli cut into two argments because of the space.

@endiliey endiliey added the bug An error in the Docusaurus core causing instability or issues with its execution label Mar 5, 2019
@endiliey
Copy link
Contributor

I use window myself and was not able to reproduce this

image

Furthermore, the cli for docusaurus-init does not take any argument. It installs in the current folder. As you can see in above screenshot, my folder name is even spaces spaces spaces and it still works.

Do you mind to send in screenshots or videos and report it if it still persists ? Thank you

@Xarkam
Copy link
Author

Xarkam commented Mar 28, 2019

Hello and thank you for your answer.

Are you serious?

I give you an example in powershell/Dos and you answer me with ubuntu for windows.

If it's something linux only, please update your documentation.

@JoelMarcey
Copy link
Contributor

@Xarkam I don’t think questioning @endiliey’s seriousness of his response is helpful or called for. He took the time to provide a thoughtful answer and asked for more information if you had it. In no way was he condescending to you, and I would hope for the same level of respect in return. Thank you.

Sent with GitHawk

@endiliey
Copy link
Contributor

endiliey commented Mar 28, 2019

My bad. I wasn't aware that it was on powershell/dos. There is no mention on it.

image

I wasn't able to reproduce it even with command prompt though.

image

Edit: Let me try with powershell and I'll get back to you in a while

@endiliey
Copy link
Contributor

I'm really sorry. I still couldn't reproduce it.

image

If you don't mind, you can send us a screenshot/video to better describe the situation.
I'll be happy to do my best to help and maybe we can fix it. 😉

@Xarkam
Copy link
Author

Xarkam commented Mar 28, 2019

@endiliey thank you for response as part of my problem.
@JoelMarcey do you think that the first answer is in the context of my problem? I do not think so.

@endiliey I will take some time tomorrow to redo the procedure as indicated in the documentation.
It may be that in the meantime an update will fix the problem. Otherwise, it will be necessary to understand it cuts the path in two parts on my system

@JoelMarcey
Copy link
Contributor

@JoelMarcey do you think that the first answer is in the context of my problem? I do not think so.

@Xarkam That's actually not the point. Whether the initial response answered your question, there are more appropriate and respectful ways to make your disagreement known than "Are you serious?".

s/Are you serious?/Thank you for taking the time to try to provide an answer, but I don't think it fully captures the issue.

s/Are you serious?/I see you tried that using Ubuntu via Powershell. Could you please try using Windows directly?

s/Are you serious?/I believe you may not have captured the essence of my question because you were using Ubuntu and not Windows.

@endiliey is one of our most active and prolific Docusaurus contributors who is really trying to help improve Docusaurus. In no way was he purposely not trying to answer your question.

It is quite clear the essence of your response was disparaging. Maybe it wasn't on purpose, I hope not.

Anyway, I appreciate you filing a bug report and it looks like there may be a path forward to continue to try to resolve this issue. I am going to consider this ancillary matter closed so that we can continue down the technical discussion path.

Thanks.

@JoelMarcey JoelMarcey added the status: needs more information There is not enough information to take action on the issue. label Mar 28, 2019
@JoelMarcey
Copy link
Contributor

Also, for now I will reopen this issue since it sounds like there may be some continued work towards a resolution here.

@JoelMarcey JoelMarcey reopened this Mar 28, 2019
@Xarkam
Copy link
Author

Xarkam commented Mar 29, 2019

Hello, I just testing this morning.
image
image
Run install in normal user mode
image
Run install in admin user mode
image
User folder:
image
Logs:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'docusaurus-init@latest',
1 verbose cli   '--global',
1 verbose cli   '--prefix',
1 verbose cli   'C:\\Users\\Benjamin',
1 verbose cli   'Nolmans\\AppData\\Roaming\\npm-cache\\_npx\\9576',
1 verbose cli   '--loglevel',
1 verbose cli   'error',
1 verbose cli   '--json' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session dd168d0c4e355131
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for file:Nolmans\AppData\Roaming\npm-cache\_npx\9576 Could not install from "Nolmans\AppData\Roaming\npm-cache\_npx\9576" as it does not contain a package.json file.
8 http fetch GET 304 https://registry.npmjs.org/docusaurus-init 936ms (from cache)
9 silly pacote tag manifest for docusaurus-init@latest fetched in 958ms
10 timing stage:rollbackFailedOptional Completed in 0ms
11 timing stage:runTopLevelLifecycles Completed in 1243ms
12 verbose stack Error: ENOENT: no such file or directory, open 'C:\Developpement\docu\Nolmans\AppData\Roaming\npm-cache\_npx\9576\package.json'
13 verbose cwd C:\Developpement\docu
14 verbose Windows_NT 10.0.17763
15 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "docusaurus-init@latest" "--global" "--prefix" "C:\\Users\\Benjamin" "Nolmans\\AppData\\Roaming\\npm-cache\\_npx\\9576" "--loglevel" "error" "--json"
16 verbose node v10.14.0
17 verbose npm  v6.4.1
18 error code ENOLOCAL
19 error Could not install from "Nolmans\AppData\Roaming\npm-cache\_npx\9576" as it does not contain a package.json file.
20 verbose exit [ 1, true ]

### Look this line in logs:

verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "docusaurus-init@latest" "--global" "--prefix" "C:\\Users\\Benjamin" "Nolmans\\AppData\\Roaming\\npm-cache\\_npx\\9576" "--loglevel" "error" "--json"

The path is separate in two arguments:
first: "C:\\Users\\Benjamin"
second: "Nolmans\\AppData\\Roaming\\npm-cache\\_npx\\9576"
The normal path is : "C:\\Users\\Benjamin Nolmans\\AppData\\Roaming\\npm-cache\\_npx\\9576"
image

So, why my path is cut on space ?

@endiliey
Copy link
Contributor

Looking at your log, it seems to be not related to docusaurus. But 'npx' package itself. You might want to file an issue at https://github.com/zkat/npx

However, I took my time to investigate and find that this issue you are facing is in fact happening with many other cli app too. See below, the log is very identical to your log.

Running install in user mode

zkat/npx#100

Run install in admin user mode

zkat/npx#146

Conclusion: **this bug is caused by npx and not docusaurus itself.

There are various solutions shown in that issue, you might want to look at that.

If it still doesn't, did you try the alternative commands to install docusaurus that we have written in our documentation ?
See https://docusaurus.io/docs/en/installation

yarn global add docusaurus-init
docusaurus-init

I believe this is worth closing. Thank you for the time 😉

@Xarkam
Copy link
Author

Xarkam commented Mar 29, 2019

Thanks @endiliey.

If this problem is recurrent with npx, why no adding a note in getting started documentation about this ?
This would allow people who also encounter this problem to know what to do.

I did not follow the procedure with yarn because I thought that it did not concern me since I use node 10.

@JoelMarcey
Copy link
Contributor

@Xarkam - we encourage those that feel the documentation could use improvement to send a pull request to update it. We are generally very accommodating to such changes, assuming they provide value to those that use or are starting to use Docusaurus.

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 status: needs more information There is not enough information to take action on the issue.
Projects
None yet
Development

No branches or pull requests

3 participants