英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论