[英]“docker-compose: not found” in Jenkins pipeline. Tried adding path to environment
[英]Cypress with Docker and Jenkins pipeline. String does not match pattern error message
我正在参加 cypress 6+ 培训课程,并且正在尝试使用 docker 运行 Jenkins 管道。 我的终端显示以下消息。 我试图弄清楚如何解决这个问题。
{
"resource": "/Users/xxx/Documents/CypressDocker_JenkinsPipeline/package.json",
"owner": "_generated_diagnostic_collection_name_#2",
"severity": 4,
"message": "String does not match the pattern of \"^(?:@[a-z0-9-*~][a-z0-9-*._~]*/)?[a-z0-9-~][a-z0-9-._~]*$\".",
"startLineNumber": 2,
"startColumn": 11,
"endLineNumber": 2,
"endColumn": 26
}
package json 似乎有问题,所以我看了一下。 老实说,我看不出问题出在哪里,我很想用另一双眼睛看一看。
{
"name": "CypressDocker_JenkinsPipeline",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "cypress run",
"headTest": "npm run test -- --headed ",
"choromeTest": "npm run test -- --browser chrome ",
"build:and:test": "npm run cy:run start-server-and-test start https://react-redux.realworld.io/ cy:run"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"cypress": "^7.1.0"
},
"devDependencies": {},
"description": ""
}
您需要更新脚本'build:and:test',我看到启动 cypress 的问题 - 正确的命令应该是
npm run cy:run
请分享课程链接
好的,我知道出了什么问题。 我从另一个文件复制了该文件,但没有创建新的 package.json 文件。 因此,当我保存文件时,package.json 用于原始文件,并未反映新文件中的更改。 所以赛普拉斯对发生的事情感到困惑。
然后,我创建了一个新的 package.json 文件,其中包含正确的信息,我添加了运行 cypress 脚本的命令(标题为 Chrome 和 Docker)。 保存它,重新启动 VS 代码,错误就消失了。
我还修改了构建和测试。 所以代码现在读入 package.json
"build:and:test": "npm run start-server-and-test start https://react-redux.realworld.io/ cy:run"
只是让它仔细检查命令是否正确。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.