I’m new to protractor, can somebody tell me how to fix error code 105

Q$ protractor conf.js

[16:29:26] E/configParser - Error code: 105
[16:29:26] E/configParser - Error message: failed loading configuration file conf.js
[16:29:26] E/configParser - Error: Cannot find module '/Users/q/conf.js'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at ConfigParser.addFileConfig (/usr/local/lib/node_modules/protractor/built/configParser.js:128:26)
    at Object.initFn [as init] (/usr/local/lib/node_modules/protractor/built/launcher.js:93:22)
    at Object.<anonymous> (/usr/local/lib/node_modules/protractor/built/cli.js:219:10)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)

I’m trying to do this using tutorial on protractor site.

Error: Cannot find module '/Users/q/conf.js'

Seems that you’re probably running your protractor CLI command from a directory that the file doesn’t exist in. It looks like you’re trying to run this from your user’s home directory and not a project folder, etc. so I’m a little suspicious based on those paths.

Code:

exports.config = {
    directConnect: true,
    framework: 'jasmine',
    seleniumAddress: 'https://localhost:4444/wd/hub',
    specs: ['spec.js'],
}

I am getting the following error, kindly suggest me some solution on this:

Error:

C:UserspraveWV Automation>protractor config.js
[17:53:50] E/configParser - Error code: 105
[17:53:50] E/configParser - Error message: configuration file config.js did not export a config object
[17:53:50] E/configParser - Error: configuration file config.js did not export a config object
    at ConfigParser.addFileConfig (C:UserspraveAppDataRoamingnpmnode_modulesprotractorbuiltconfigParser.js:141:19)
    at Object.initFn [as init] (C:UserspraveAppDataRoamingnpmnode_modulesprotractorbuiltlauncher.js:93:22)
    at Object.<anonymous> (C:UserspraveAppDataRoamingnpmnode_modulesprotractorbuiltcli.js:226:10)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)a
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (C:UserspraveAppDataRoamingnpmnode_modulesprotractorbinprotractor:5:1)

0

[16:29:26] E/configParser – Error message: failed loading configuration file conf.js

Solution: the loading configuration file error is due to the File Path. I suggest you try the below command and check if it works.

Protractor

I received the same error on Jenkins run, while locally my Protractor tests worked fine. The issue was that .gitignore had excluded all .js (/e2e/*.js) files compiled from .ts, and the config js file was not sent to the origin repo.

The fix was as simple as to add !*.conf.js to the .gitignore and push the commit to the origin.

Make sure you have your config files in the path it should be 🙂