Skip to content

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

@dkhalife

Description

@dkhalife

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions