我正在尝试部署此示例 NextJS app,但每当我运行now命令时,都会收到以下错误:
At C:\Users\Ben\AppData\Local\Yarn\bin\now.ps1:5 char:13
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+ ~
Unexpected token ')' in expression or statement.
At C:\Users\Ben\AppData\Local\Yarn\bin\now.ps1:8 char:3
+ if [ -x "$basedir/pwsh" ]; then
+ ~
Missing '(' after 'if' in if statement.
At C:\Users\Ben\AppData\Local\Yarn\bin\now.ps1:8 char:5
+ if [ -x "$basedir/pwsh" ]; then
+ ~
Missing type name after '['.
At C:\Users\Ben\AppData\Local\Yarn\bin\now.ps1:9 char:20
+ ... sedir/pwsh" "$basedir/../Data/global/node_modules/.bin/now.ps1" "$@"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token '"$basedir/../Data/global/node_modules/.bin/now.ps1"' in
expression or statement.
At C:\Users\Ben\AppData\Local\Yarn\bin\now.ps1:9 char:72
+ ... sedir/pwsh" "$basedir/../Data/global/node_modules/.bin/now.ps1" "$@"
+ ~~~~
Unexpected token '"$@"' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParseException
+ FullyQualifiedErrorId : UnexpectedToken
我按照所有步骤创建了now.json和next.config.js文件,但我尝试部署此示例 NextJS 应用程序仍然没有成功。
为了诊断问题,我尝试通过运行以下命令在全局范围内安装:
yarn global add now
但这无助于解决问题。
我会缺少一个步骤吗?谢谢您的帮助。
编辑:顺便说一句,我在 Windows 机器上,我在 PowerShell 上运行了命令。