简体   繁体   English

量角器无法找到配置文件:错误:找不到模块'/protractor/protractor.conf_sanity.js'

[英]Protractor unable to find config file: Error: Cannot find module '/protractor/protractor.conf_sanity.js'

Protractor version: 5.4.2 量角器版本: 5.4.2

Present working directory: /protractor 当前工作目录: /protractor

CLI to run the test: sudo -u protractor xvfb-run --server-args="-screen 0 1280x1024x24" -a protractor $@ CLI运行测试: sudo -u protractor xvfb-run --server-args="-screen 0 1280x1024x24" -a protractor $@

File is present in the directory: -rw-rw-rw-. 1 jenkins jenkins 5528 Nov 23 07:14 protractor.conf_sanity.js 文件位于目录-rw-rw-rw-. 1 jenkins jenkins 5528 Nov 23 07:14 protractor.conf_sanity.js -rw-rw-rw-. 1 jenkins jenkins 5528 Nov 23 07:14 protractor.conf_sanity.js

The test is failing with below error: 测试失败,并出现以下错误:

[06:37:35] E/configParser - Error code: 105

[06:37:35] E/configParser - Error message: failed loading configuration file protractor.conf_sanity.js

[06:37:35] E/configParser - Error: Cannot find module '/protractor/protractor.conf_sanity.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
    at Function.Module._load (internal/modules/cjs/loader.js:475:25)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at ConfigParser.addFileConfig (/usr/lib/node_modules/protractor/built/configParser.js:135:26)
    at Object.initFn [as init] (/usr/lib/node_modules/protractor/built/launcher.js:93:22)
    at Object.<anonymous> (/usr/lib/node_modules/protractor/built/cli.js:226:10)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)

I have been scratching my head for a few days for this. 为此,我已经挠了几天头。 What am I missing? 我想念什么?

I add pwd and ls -lrt $@ to the entrypoint script and it is finding the file. 我将pwdls -lrt $@添加到入口点脚本中,并且正在查找文件。

/protractor

-rw-rw-rw-. 1 jenkins jenkins 5528 Nov 23 07:14 protractor.conf_dev_sanity.js

A shot in a dark... 在黑暗中射击...

Your CLI command looks weird to me 您的CLI命令对我来说很奇怪

I start tests like so 我像这样开始测试

xvfb-run -a --server-args="-screen 0 ${SCREEN_RES}" protractor protractor.conf.js

Can you try this? 你可以试试这个吗?


As to WHAT is happening I think it looks for /protractor/protractor.conf_sanity.js while already in working directory... essentially under /protractor/protractor/protractor.conf_sanity.js . 至于发生了什么,我认为它看起来/protractor/protractor.conf_sanity.js而已经在工作目录...基本上下/protractor/protractor/protractor.conf_sanity.js But no idea WHY it's happening 但是不知道为什么会这样

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM