安装react devtools后,我将无法再运行expo-cli。在我这么做之前,一切都很顺利。我现在得到下面的错误。我的Powershell权限也被更改为"受限"。我已经将我的注册表恢复到前一天,并卸载/重新安装了node和yarn以修复此问题。
错误列表中列出了Cygwin,我的计算机上没有安装它(没有显示在注册表搜索中),然而,在搜索我的计算机时,我发现Cygwin安装了Git:
C: \Program Files\Git\usr\share\cygwin
C:\Program Files\Git\/usr/bin\cygwin-console helper.exe
C:\Program Files\Android\Android Studio\bin\lldb\lib\distutils\cygwinccompiler.py
C:\Program Files\Git\\usr\lib\perlS\core_per|\File\Spec\cygwin.pm
C:\Program Files \Git\usr \share\cygwin\ldif \cygwin
C:\ProgramFiles\Git\usr\lib\termif0\63\cygwin
如有任何帮助,我们将不胜感激
Windows 10
npm:6.6.0
节点:v10.15.0
纱线:v1.13.0
expo start --android
At C:UsersnameAppDataLocalYarnbinexpo.ps1:5 char:13
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+ ~
Unexpected token ')' in expression or statement.
At C:UsersnameAppDataLocalYarnbinexpo.ps1:8 char:3
+ if [ -x "$basedir/pwsh" ]; then
+ ~
Missing '(' after 'if' in if statement.
At C:UsersnameAppDataLocalYarnbinexpo.ps1:8 char:5
+ if [ -x "$basedir/pwsh" ]; then
+ ~
Missing type name after '['.
At C:UsersnameAppDataLocalYarnbinexpo.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:UsersnameAppDataLocalYarnbinexpo.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
@supermerio
C:\Users\name\AppData\Local\Yarn\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\lactfact_190118\node_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
这是一个已知的Yarn1.13.0
问题:https://github.com/yarnpkg/yarn/issues/6902#issuecomment-453534280
看起来"C:\Users\name\AppData\Local\Yarn\bin\expo.ps1"中的if语句格式不正确。
你能查看该文件进行确认吗?如果可能,请在此处张贴。