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

Spaces in the project path cause run-windows to fail #865

Closed
dkhalife opened this issue Nov 8, 2016 · 5 comments
Closed

Spaces in the project path cause run-windows to fail #865

dkhalife opened this issue Nov 8, 2016 · 5 comments

Comments

@dkhalife
Copy link

dkhalife commented Nov 8, 2016

After executing react-native run-windows Powershell commands fail if there are spaces in the project path.

I’ve tracked the offending lines to this file:
https://github.com/ReactWindows/react-native-windows/blob/9896aaa35b2da8ea1cbf941feb549c60c79569f7/local-cli/runWindows/utils/deploy.js

Lines 20, 83, 86, 89 and 92

Here's the initial error you get in the "untouched" state of the code :

Starting the React-Native Server
Unblock-File : A positional parameter cannot be found that accepts argument
'Native\proj\node_modules\react-native-windows\local-cli\runWindows\utils\WindowsStoreAppUtils.ps1'.
At line:1 char:1
+ Unblock-File E:\React Native\proj\node_modules\react-native-windows\l ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Unblock-File], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.UnblockFileCommand

Failed to deploy: Command failed: powershell Unblock-File "E:\React Native\proj\node_modules\react-native-windows\local-cli\runWindows\utils\WindowsStoreAppUtils.ps1"
Unblock-File : A positional parameter cannot be found that accepts argument
'Native\proj\node_modules\react-native-windows\local-cli\runWindows\utils\WindowsStoreAppUtils.ps1'.
At line:1 char:1
+ Unblock-File E:\React Native\proj\node_modules\react-native-windows\l ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Unblock-File], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.UnblockFileCommand

When commenting out the faulty powershell commands everything runs fine.

@rozele
Copy link
Collaborator

rozele commented Nov 9, 2016

I'm struggling to come up with a good solution for this. I've searched for a few minutes for how to manage paths with spaces in them when invoking powershell from cmd but so far have come up empty handed.

Is it possible to just not do this in a path with spaces ;-). If you have any specific suggestions for this, or have a few minutes to commit to this, would be great to get a PR. I've tried:

  • wrapping the path as $("path")
  • wrapping the path as ("path")
  • wrapping the path as path
  • prepending the path with &

None of these things work.

@dkhalife
Copy link
Author

dkhalife commented Nov 9, 2016

Oh yeah, no worries. I've already fixed the path in my project. Just thought I'd report the bug when I stumbled upon it. But yeah I'll give it a try myself as well and if I get something I'll let you know :)

@giacomocerquone
Copy link

giacomocerquone commented May 28, 2018

I still have this problem, how so? What can I do to fix this istantly and then wait for the maintainer to fix it?

@Olabisim
Copy link

Hello, i still couldn't solve this issue or bypass it for more than a week. i really need help,
image
what can i do to solve this error?

@ghost ghost added the Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) label Apr 19, 2022
@Olabisim
Copy link

solution to this issue is to remove any special characters or spaces from your paths structure, my main folder was named DESKTOP APP so i changed it to DESKTOPAPP and rerun the app and it worked fine... you can also read my blog for detailed explanation of the errors i went through

https://medium.com/@olabisiajoseh/setting-up-a-react-native-desktop-app-in-5-minutes-d06718838caa

@chrisglein chrisglein removed the Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) label Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants