gpt4 book ai didi

node.js - 启动服务器并测试 "server closed unexpectedly"

转载 作者:行者123 更新时间:2023-12-04 00:20:07 25 4
gpt4 key购买 nike

我正在使用start-server-and-test package在我的 Azure 管道上启动服务器来运行 Cypress。

这是我用来启动一切的 yarn 命令:yarn cy:build:workspace

"cy:build:workspace": "yarn cy:clean && start-server-and-test start http://localhost:8080 cy:run:workspace"

我正在 Azure 环境中运行 NODE_VERSION:“12.10.0”。

"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "d:\a\_temp\ce28689e-eef6-4eeb-bad2-82310f748e1b.cmd""
yarn run v1.22.4
$ yarn cy:clean && start-server-and-test start http://localhost:3000 cy:run:workspace
$ rimraf cypress/reports/*
1: starting server using command "npm run start"
and when url "[ 'http://localhost:3000' ]" is responding with HTTP status code 200
running tests using command "npm run cy:run:workspace"


> @someProjectsbs/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f685839f8293db8697959d97919385b6c6d8c7d8c7" rel="noreferrer noopener nofollow">[email protected]</a> start D:\a\1\s
> lerna exec --scope=@someProjectsbs/suite -- yarn start --all-apps

lerna notice cli v3.20.2
lerna info ci enabled
lerna notice filter including "@someProjectsbs/suite"
lerna info filter [ '@someProjectsbs/suite' ]
lerna info Executing command in 1 package: "yarn start --all-apps"
$ cross-env react-app-rewired start --extended-linting --all-apps
[]
[info] [webpackbar] Compiling @someProjectsbs/suite
(node:4672) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
i 「wds」: Project is running at http://192.168.0.100/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from D:\a\1\s\packages\app\suite\public
i 「wds」: 404s will fallback to /
Starting the development server...

lerna success exec Executed command in 1 package: "yarn start --all-apps"
Error: server closed unexpectedly
at ChildProcess.onClose (D:\a\1\s\node_modules\start-server-and-test\src\index.js:69:14)
at ChildProcess.emit (events.js:209:13)
at ChildProcess.cp.emit (D:\a\1\s\node_modules\start-server-and-test\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
##[error]Cmd.exe exited with code '1'.
Finishing: Run Cypress testsk

本地一切都在运行,对于服务器在 Azure 环境中停止的原因有什么建议吗?

最佳答案

如果您使用的是“react-scripts”,请检查您的 package.json:“3.4.1”降级到 3.4.0

还要验证此链接以将start-server-and-test与yarn一起使用,您需要添加类似字符串的一些yarn命令 https://github.com/bahmutov/start-server-and-test#note-for-yarn-users

关于node.js - 启动服务器并测试 "server closed unexpectedly",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61374752/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com