【问题标题】:ZEIT Now - command doesn't work for NextJSZEIT Now - 命令不适用于 NextJS
【发布时间】:2019-06-12 05:54:35
【问题描述】:

我正在尝试部署此 example 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.jsonnext.config.js 文件,但是我尝试部署这个 NextJS 示例仍然没有成功应用程序。

为了诊断问题,我尝试通过运行以下命令全局立即安装:

yarn global add now

但这无助于解决问题。

我会缺少一个步骤吗?感谢您的帮助。

编辑:顺便说一句,我在 Windows 机器上,我在 PowerShell 上运行了命令。

【问题讨论】:

    标签: vercel


    【解决方案1】:

    包管理工具yarn有问题。我从 yarn 中卸载了它,并改为使用 npm 全局安装它。

    【讨论】:

      猜你喜欢
      • 2019-05-12
      • 2019-12-23
      • 1970-01-01
      • 2019-12-12
      • 2020-08-03
      • 2021-06-17
      • 2011-03-28
      • 1970-01-01
      • 2019-09-01
      相关资源
      最近更新 更多