Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell React Native/Expo/Cygwin“;意外标记”;问题_Powershell_React Native_Cygwin_Expo - Fatal编程技术网

Powershell React Native/Expo/Cygwin“;意外标记”;问题

Powershell React Native/Expo/Cygwin“;意外标记”;问题,powershell,react-native,cygwin,expo,Powershell,React Native,Cygwin,Expo,安装react devtools后,我无法再运行expo cli。 在我这么做之前,一切都很顺利。我现在得到下面的错误。 我的Powershell权限也更改为“受限”。我已将注册表恢复到前一天,并已卸载/重新安装node和Thread以修复此问题 错误列出了Cygwin,我的计算机上没有安装它(不会显示在注册表搜索中),但是,在搜索我的计算机时,我看到Cygwin是与Git一起安装的: C:\ProgramFiles\Git\usr\share\cygwin C:\ProgramFiles\Gi

安装react devtools后,我无法再运行expo cli。 在我这么做之前,一切都很顺利。我现在得到下面的错误。 我的Powershell权限也更改为“受限”。我已将注册表恢复到前一天,并已卸载/重新安装node和Thread以修复此问题

错误列出了Cygwin,我的计算机上没有安装它(不会显示在注册表搜索中),但是,在搜索我的计算机时,我看到Cygwin是与Git一起安装的:

C:\ProgramFiles\Git\usr\share\cygwin
C:\ProgramFiles\Git\usr\bin\cygwin console helper.exe C:\ProgramFiles\Android\Android Studio\bin\lldb\lib\distutils\cygwinccompiler.py
C:\ProgramFiles\Git\usr\lib\perlS\core\u per |\File\Spec\cygwin.pm
C:\ProgramFiles\Git\usr\share\cygwin\cygwin.ldif
C:\ProgramFiles\Git\usr\share\tern1info\63\cygwin
C:\ProgramFiles\Git\usr\lib\termf0\63\cygwin

任何帮助都将不胜感激。
Windows 10
npm:6.6.0
节点:v10.15.0
纱线:v1.13.0

expo start --android
At C:\Users\name\AppData\Local\Yarn\bin\expo.ps1:5 char:13
+     *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+             ~
Unexpected token ')' in expression or statement.
At C:\Users\name\AppData\Local\Yarn\bin\expo.ps1:8 char:3
+ if [ -x "$basedir/pwsh" ]; then
+   ~
Missing '(' after 'if' in if statement.
At C:\Users\name\AppData\Local\Yarn\bin\expo.ps1:8 char:5
+ if [ -x "$basedir/pwsh" ]; then
+     ~
Missing type name after '['.
At C:\Users\name\AppData\Local\Yarn\bin\expo.ps1:9 char:20
+ ... edir/pwsh"  "$basedir/../Data/global/node_modules/.bin/expo.ps1" "$@" ...
+   
Unexpected token '"$basedir/../Data/global/node_modules/.bin/expo.ps1"' in expression or statement.
At C:\Users\name\AppData\Local\Yarn\bin\expo.ps1:9 char:73
+ ... edir/pwsh"  "$basedir/../Data/global/node_modules/.bin/expo.ps1" "$@"
+   
Unexpected token '"$@"' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : UnexpectedToken
@超验

C:\Users\name\AppData\Local\warn\bin\expo.ps1

#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
    *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac

if [ -x "$basedir/pwsh" ]; then
  "$basedir/pwsh"  "$basedir/../Data/global/node_modules/.bin/expo.ps1" "$@"
  ret=$?
else 
  pwsh  "$basedir/../Data/global/node_modules/.bin/expo.ps1" "$@"
  ret=$?
fi
exit $ret
此外,我还可以将expo安装到我的回购协议中并从那里调用它,从而使其正常工作。 我注意到本地脚本与全局安装中的脚本有所不同。本地脚本调用“node”,其中全局脚本(上面)调用“pwsh”

\LactFacts\LactFacts\u 190118\node\u modules.bin\expo:

#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
    *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac

if [ -x "$basedir/node" ]; then
  "$basedir/node"  "$basedir/../expo-cli/bin/expo.js" "$@"
  ret=$?
else 
  node  "$basedir/../expo-cli/bin/expo.js" "$@"
  ret=$?
fi
exit $ret

看起来“C:\Users\name\AppData\Local\Thread\bin\expo.ps1”中的任何语句都有一个格式错误的if语句


您是否能够查看该文件以进行确认?如果可能,在这里发布。

这是一个已知的
1.13.0
问题:

无法格式化评论,所以我在上面的OP中发布了。谢谢。expo.ps1中的代码不是powershell,尽管它似乎试图被解释为powershell。