我尝试在本地运行Vercel,但没有成功。

huangapple go评论93阅读模式
英文:

I tried running Vercel locally but did not work

问题

我正在使用 Next Js 开发项目,并且使用 Vercel 作为我的服务器。我需要在本地运行 Vercel,但当我这样做时,我会收到以下错误信息。

错误信息如下:

> 运行 Dev 命令 "vite --port $PORT"
'cmd.exe' 不被识别为内部或外部命令,可执行程序或批处理文件。
错误:spawn cmd.exe ENOENT
    在 notFoundError (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178102:26)
    在 verifyENOENT (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178136:16)
    在 ChildProcess.cp.emit (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178123:25)
    在 Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
错误:发生了意外错误!
错误:spawn cmd.exe ENOENT
    在 notFoundError (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178102:26)
    在 verifyENOENT (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178136:16)
    在 ChildProcess.cp.emit (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178123:25)
    在 Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)

JS@Udemezue MINGW64 ~/Desktop/Copy-and-Post/ui-copyandpost (sit)
$ vercel dev
Vercel CLI 28.10.1
> 运行 Dev 命令 "vite --port $PORT"
'cmd.exe' 不被识别为内部或外部命令,可执行程序或批处理文件。
错误:spawn cmd.exe ENOENT
    在 notFoundError (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178102:26)
    在 verifyENOENT (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178136:16)
    在 ChildProcess.cp.emit (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178123:25)
    在 Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
错误:发生了意外错误!
错误:spawn cmd.exe ENOENT
    在 notFoundError (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178102:26)
    在 verifyENOENT (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178136:16)
    在 ChildProcess.cp.emit (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178123:25)
    在 Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)

希望这可以帮助你解决问题。

英文:

I am developing a project using Next Js and I use Vercel as a my server, I Need to run Vercel locally, but when I do I get the following errors.

Vercel Dev

Here are the errors.

> Running Dev Command “vite --port $PORT”
'cmd.exe' is not recognized as an internal or external command,
operable program or batch file.
Error: spawn cmd.exe ENOENT
    at notFoundError (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178102:26)
    at verifyENOENT (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178136:16)
    at ChildProcess.cp.emit (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178123:25)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
Error: An unexpected error occurred!
Error: spawn cmd.exe ENOENT
    at notFoundError (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178102:26)
    at verifyENOENT (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178136:16)
    at ChildProcess.cp.emit (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178123:25)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)

JS@Udemezue MINGW64 ~/Desktop/Copy-and-Post/ui-copyandpost (sit)
$ vercel dev
Vercel CLI 28.10.1
> Running Dev Command “vite --port $PORT”
'cmd.exe' is not recognized as an internal or external command,
operable program or batch file.
Error: spawn cmd.exe ENOENT
    at notFoundError (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178102:26)
    at verifyENOENT (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178136:16)
    at ChildProcess.cp.emit (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178123:25)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
Error: An unexpected error occurred!
Error: spawn cmd.exe ENOENT
    at notFoundError (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178102:26)
    at verifyENOENT (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178136:16)
    at ChildProcess.cp.emit (C:\Program Files (x86)\nodejs\node_modules\vercel\dist\index.js:178123:25)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)

答案1

得分: 0

问题已解决,我没有在本地安装 Vercel。

npm install -g vercel

执行此操作,它应该可以正常工作。

英文:

Issue solved, I did not install Vercel Locally

npm install -g vercel

Do this and it should work just fine.

huangapple
  • 本文由 发表于 2023年8月10日 23:13:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76877092.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定