AzureDevOps管道-Nightwatch硒独立安装问题-无法运行npm run'e2e-setup'(包含'硒独立安装')]]

问题描述 投票:0回答:1

我正在尝试使用各种浏览器设置Selenium独立服务器,脚本在我的本地计算机上运行良好,但是在使用Azure DevOps工具在Azure云上运行时也会遇到问题。

从日志中(末尾有详细日志),我看到以下内容,但不确定如何解决:

2020-04-17T21:39:25.3581171Z Usage: selenium-standalone action [options]
2020-04-17T21:39:25.3581533Z 
2020-04-17T21:39:25.3582171Z npm ERR! Linux 5.0.0-1031-azure
2020-04-17T21:39:25.3582843Z npm ERR! argv "/vsts/agent/_work/_tool/node/6.17.1/x64/bin/node" "/vsts/agent/_work/_tool/node/6.17.1/x64/bin/npm" "run" "e2e-setup"
2020-04-17T21:39:25.3583217Z npm ERR! node v6.17.1
2020-04-17T21:39:25.3583400Z npm ERR! npm  v3.10.10
2020-04-17T21:39:25.3583580Z npm ERR! code ELIFECYCLE
2020-04-17T21:39:25.3584038Z npm ERR! [email protected] e2e-setup: `selenium-standalone install`
2020-04-17T21:39:25.3584332Z npm ERR! Exit status 255

我有以下package.json:

{
  "name": "temp",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "nightwatch",
    "e2e-setup": "selenium-standalone install"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@babel/core": "^7.9.0",
    "@babel/preset-env": "^7.9.0",
    "babel-core": "^6.26.3",
    "babel-plugin-add-module-exports": "^1.0.2",
    "babel-preset-env": "^1.7.0",
    "babel-preset-es2015": "^6.24.1",
    "gulp-babel": "^8.0.0-beta.2",
    "selenium-standalone": "^6.17.0"
  },
  "dependencies": {
    "easy-soap-request": "^3.2.2",
    "nightwatch": "^1.3.4",
    "xmldom": "^0.3.0"
  }
}

我运行时在VScode上npm安装守夜人npm独立安装硒和npm运行e2e-setup

当我在机器上尝试以上操作时,我没有任何问题-Selenium服务器jar和所有浏览器(chrome,firefox,即Edge)二进制文件都已下载)

以上设置如硒独立式npm官方网站(https://www.npmjs.com/package/selenium-standalone#install--run)中所述

我的Azure CI设置:

enter image description here

但是当我在Azure DevOps工具上尝试相同的操作(在Azure云上运行相同的操作时,出现如下问题:

2020-04-17T21:39:22.1913471Z ##[section]Starting: npm run e2e-setup
2020-04-17T21:39:22.1923363Z ==============================================================================
2020-04-17T21:39:22.1923659Z Task         : npm
2020-04-17T21:39:22.1924046Z Description  : Install and publish npm packages, or run an npm command. Supports npmjs.com and authenticated registries like Azure Artifacts.
2020-04-17T21:39:22.1924428Z Version      : 1.166.1
2020-04-17T21:39:22.1924652Z Author       : Microsoft Corporation
2020-04-17T21:39:22.1924983Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/npm
2020-04-17T21:39:22.1925348Z ==============================================================================
2020-04-17T21:39:22.5235427Z SYSTEMVSSCONNECTION exists true
2020-04-17T21:39:22.7105531Z SYSTEMVSSCONNECTION exists true
2020-04-17T21:39:22.7890296Z [command]/vsts/agent/_work/_tool/node/6.17.1/x64/bin/npm --version
2020-04-17T21:39:23.0268360Z 3.10.10
2020-04-17T21:39:23.9587311Z [command]/vsts/agent/_work/_tool/node/6.17.1/x64/bin/npm config list
2020-04-17T21:39:24.4295571Z ; cli configs
2020-04-17T21:39:24.4297644Z user-agent = "npm/3.10.10 node/v6.17.1 linux x64"
2020-04-17T21:39:24.4298039Z 
2020-04-17T21:39:24.4298357Z ; environment configs
2020-04-17T21:39:24.4298785Z userconfig = "/vsts/agent/_work/_temp/npm/830.npmrc"
2020-04-17T21:39:24.4299106Z 
2020-04-17T21:39:24.4299481Z ; node bin location = /vsts/agent/_work/_tool/node/6.17.1/x64/bin/node
2020-04-17T21:39:24.4300000Z ; cwd = /vsts/agent/_work/r2/a/_QA_IDLookUp
2020-04-17T21:39:24.4300385Z ; HOME = /root
2020-04-17T21:39:24.4301230Z ; "npm config ls -l" to show all defaults.
2020-04-17T21:39:24.4301526Z 
2020-04-17T21:39:24.4304850Z [command]/vsts/agent/_work/_tool/node/6.17.1/x64/bin/npm run e2e-setup
2020-04-17T21:39:25.3579514Z not found: java
2020-04-17T21:39:25.3579860Z 
2020-04-17T21:39:25.3581171Z Usage: selenium-standalone action [options]
2020-04-17T21:39:25.3581533Z 
2020-04-17T21:39:25.3582171Z npm ERR! Linux 5.0.0-1031-azure
2020-04-17T21:39:25.3582843Z npm ERR! argv "/vsts/agent/_work/_tool/node/6.17.1/x64/bin/node" "/vsts/agent/_work/_tool/node/6.17.1/x64/bin/npm" "run" "e2e-setup"
2020-04-17T21:39:25.3583217Z npm ERR! node v6.17.1
2020-04-17T21:39:25.3583400Z npm ERR! npm  v3.10.10
2020-04-17T21:39:25.3583580Z npm ERR! code ELIFECYCLE
2020-04-17T21:39:25.3584038Z npm ERR! [email protected] e2e-setup: `selenium-standalone install`
2020-04-17T21:39:25.3584332Z npm ERR! Exit status 255
2020-04-17T21:39:25.3584511Z npm ERR! 
2020-04-17T21:39:25.3584965Z npm ERR! Failed at the [email protected] e2e-setup script 'selenium-standalone install'.
2020-04-17T21:39:25.3585333Z npm ERR! Make sure you have the latest version of node.js and npm installed.
2020-04-17T21:39:25.3585684Z npm ERR! If you do, this is most likely a problem with the temp package,
2020-04-17T21:39:25.3585947Z npm ERR! not with npm itself.
2020-04-17T21:39:25.3586231Z npm ERR! Tell the author that this fails on your system:
2020-04-17T21:39:25.3586678Z npm ERR!     selenium-standalone install
2020-04-17T21:39:25.3587020Z npm ERR! You can get information on how to open an issue for this project with:
2020-04-17T21:39:25.3587342Z npm ERR!     npm bugs temp
2020-04-17T21:39:25.3587803Z npm ERR! Or if that isn't available, you can get their info via:
2020-04-17T21:39:25.3588109Z npm ERR!     npm owner ls temp
2020-04-17T21:39:25.3588351Z npm ERR! There is likely additional logging output above.
2020-04-17T21:39:25.3588530Z 
2020-04-17T21:39:25.3588791Z npm ERR! Please include the following file with any support request:
2020-04-17T21:39:25.3589311Z npm ERR!     /vsts/agent/_work/r2/a/_QA_IDLookUp/npm-debug.log
2020-04-17T21:39:25.3590596Z > [email protected] e2e-setup /vsts/agent/_work/r2/a/_QA_IDLookUp
2020-04-17T21:39:25.3591763Z > selenium-standalone install
2020-04-17T21:39:25.3592087Z 
2020-04-17T21:39:25.3734932Z Found npm debug log, make sure the path matches with the one in npm's output: /vsts/agent/_work/r2/a/_QA_IDLookUp/npm-debug.log
2020-04-17T21:39:25.3735698Z 0 info it worked if it ends with ok
2020-04-17T21:39:25.3737184Z 1 verbose cli [ '/vsts/agent/_work/_tool/node/6.17.1/x64/bin/node',
2020-04-17T21:39:25.3738213Z 1 verbose cli   '/vsts/agent/_work/_tool/node/6.17.1/x64/bin/npm',
2020-04-17T21:39:25.3739010Z 1 verbose cli   'run',
2020-04-17T21:39:25.3739677Z 1 verbose cli   'e2e-setup' ]
2020-04-17T21:39:25.3740072Z 2 info using [email protected]
2020-04-17T21:39:25.3740401Z 3 info using [email protected]
2020-04-17T21:39:25.3741309Z 4 verbose run-script [ 'pree2e-setup', 'e2e-setup', 'poste2e-setup' ]
2020-04-17T21:39:25.3742292Z 5 info lifecycle [email protected]~pree2e-setup: [email protected]
2020-04-17T21:39:25.3743416Z 6 silly lifecycle [email protected]~pree2e-setup: no script for pree2e-setup, continuing
2020-04-17T21:39:25.3744395Z 7 info lifecycle [email protected]~e2e-setup: [email protected]
2020-04-17T21:39:25.3745399Z 8 verbose lifecycle [email protected]~e2e-setup: unsafe-perm in lifecycle true
2020-04-17T21:39:25.3747409Z 9 verbose lifecycle [email protected]~e2e-setup: PATH: /vsts/agent/_work/_tool/node/6.17.1/x64/lib/node_modules/npm/bin/node-gyp-bin:/vsts/agent/_work/r2/a/_QA_IDLookUp/node_modules/.bin:/vsts/agent/_work/_tool/node/6.17.1/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2020-04-17T21:39:25.3749200Z 10 verbose lifecycle [email protected]~e2e-setup: CWD: /vsts/agent/_work/r2/a/_QA_IDLookUp
2020-04-17T21:39:25.3750457Z 11 silly lifecycle [email protected]~e2e-setup: Args: [ '-c', 'selenium-standalone install' ]
2020-04-17T21:39:25.3751608Z 12 silly lifecycle [email protected]~e2e-setup: Returned: code: 255  signal: null
2020-04-17T21:39:25.3752743Z 13 info lifecycle [email protected]~e2e-setup: Failed to exec e2e-setup script
2020-04-17T21:39:25.3753814Z 14 verbose stack Error: [email protected] e2e-setup: `selenium-standalone install`
2020-04-17T21:39:25.3754348Z 14 verbose stack Exit status 255
2020-04-17T21:39:25.3755003Z 14 verbose stack     at EventEmitter.<anonymous> (/vsts/agent/_work/_tool/node/6.17.1/x64/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
2020-04-17T21:39:25.3755744Z 14 verbose stack     at emitTwo (events.js:106:13)
2020-04-17T21:39:25.3756353Z 14 verbose stack     at EventEmitter.emit (events.js:191:7)
2020-04-17T21:39:25.3757140Z 14 verbose stack     at ChildProcess.<anonymous> (/vsts/agent/_work/_tool/node/6.17.1/x64/lib/node_modules/npm/lib/utils/spawn.js:40:14)
2020-04-17T21:39:25.3757834Z 14 verbose stack     at emitTwo (events.js:106:13)
2020-04-17T21:39:25.3758420Z 14 verbose stack     at ChildProcess.emit (events.js:191:7)
2020-04-17T21:39:25.3759038Z 14 verbose stack     at maybeClose (internal/child_process.js:920:16)
2020-04-17T21:39:25.3759714Z 14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
2020-04-17T21:39:25.3760203Z 15 verbose pkgid [email protected]
2020-04-17T21:39:25.3760616Z 16 verbose cwd /vsts/agent/_work/r2/a/_QA_IDLookUp
2020-04-17T21:39:25.3761457Z 17 error Linux 5.0.0-1031-azure
2020-04-17T21:39:25.3762546Z 18 error argv "/vsts/agent/_work/_tool/node/6.17.1/x64/bin/node" "/vsts/agent/_work/_tool/node/6.17.1/x64/bin/npm" "run" "e2e-setup"
2020-04-17T21:39:25.3763170Z 19 error node v6.17.1
2020-04-17T21:39:25.3763496Z 20 error npm  v3.10.10
2020-04-17T21:39:25.3763826Z 21 error code ELIFECYCLE
2020-04-17T21:39:25.3764642Z 22 error [email protected] e2e-setup: `selenium-standalone install`
2020-04-17T21:39:25.3765087Z 22 error Exit status 255
2020-04-17T21:39:25.3765921Z 23 error Failed at the [email protected] e2e-setup script 'selenium-standalone install'.
2020-04-17T21:39:25.3766518Z 23 error Make sure you have the latest version of node.js and npm installed.
2020-04-17T21:39:25.3767106Z 23 error If you do, this is most likely a problem with the temp package,
2020-04-17T21:39:25.3767909Z 23 error not with npm itself.
2020-04-17T21:39:25.3768396Z 23 error Tell the author that this fails on your system:
2020-04-17T21:39:25.3769248Z 23 error     selenium-standalone install
2020-04-17T21:39:25.3769864Z 23 error You can get information on how to open an issue for this project with:
2020-04-17T21:39:25.3770358Z 23 error     npm bugs temp
2020-04-17T21:39:25.3771224Z 23 error Or if that isn't available, you can get their info via:
2020-04-17T21:39:25.3771966Z 23 error     npm owner ls temp
2020-04-17T21:39:25.3772352Z 23 error There is likely additional logging output above.
2020-04-17T21:39:25.3772813Z 24 verbose exit [ 1, true ]
2020-04-17T21:39:25.3773034Z 
2020-04-17T21:39:25.3775507Z ##[error]Error: Npm failed with return code: 1
2020-04-17T21:39:25.3816759Z ##[section]Finishing: npm run e2e-setup

我正在尝试使用各种浏览器设置硒独立服务器,该脚本在我的本地计算机上运行良好,但是使用Azure DevOps工具在Azure云上运行时也会遇到问题。从日志(...

node.js npm azure-devops e2e-testing nightwatch.js
1个回答
1
投票

node和npm的版本似乎很旧。我一直在travis,azure devops和github action上使用硒进行夜间监视测试。我的建议是通过一个非常简单的yml文件进行配置。您可以在下面的链接中查看我的,然后尝试。

© www.soinside.com 2019 - 2024. All rights reserved.