title: Certain protractor API functions cause errors
body: <p>Why am I receiving errors when I use Protractor API functions? I have scoured the internet for solutions to this problem and I found a couple similar answers, but they didnt work and so I'm asking the community.</p>
  
  <p>I am trying to set up the simplest e2e test with Karma and Protractor. 
  An empty block of test code like this will yield no error:</p>
  
  <pre><code>describe('Mapping Assistant State', () =&gt; {
     beforeEach(() =&gt; {
     });
  
     it('should display a table',() =&gt; {
        console.log('test');
     });
  
     it('should click the create Paste button',() =&gt; {
  
      });
  });
  </code></pre>
  
  <p>The problem occurs once I add certain functions from protractor like expect() or browser():</p>
  
  <pre><code>it('should display a table',() =&gt; {
      browser.get('someUrl');
      expect(element(by.css('.map')).getText()).toContain('map');
  
  });
  </code></pre>
  
  <p>Here are some of the contents of my package.json:</p>
  
  <pre><code>"protractor": "^5.3.0",
  "karma": "^1.7.1",
  "@angular/cli": "^1.6.6",
  "typescript": "^2.5.2"
  "@angular/core": "^4.3.6",
  "rxjs": "^5.4.3",
  "@types/selenium-webdriver": "^3.0.6",
  "ts-node": "^4.0.1",
  "@types/node": "^8.0.58",
  </code></pre>
  
  <p>Also:</p>
  
  <pre><code>import { browser, by, element } from 'protractor';
  import {describe} from 'selenium-webdriver/testing';
  import {beforeEach} from 'selenium-webdriver/testing';
  </code></pre>
  
  <p>Here is my <code>protractor.conf.js</code> file:</p>
  
  <pre><code>const { SpecReporter } = require('jasmine-spec-reporter');
  
  exports.config = {
      allScriptsTimeout: 11000,
      specs: [
          './e2e/**/*.e2e-spec.ts'
      ],
      capabilities: {
          'browserName': 'chrome'
      },
      directConnect: true,
      baseUrl: 'http://localhost:4200/',
      framework: 'jasmine',
      jasmineNodeOpts: {
          showColors: true,
          defaultTimeoutInterval: 30000,
          print: function() {}
      },
      onPrepare() {
          require('ts-node').register({
              project: 'e2e/tsconfig.e2e.json'
          });
          jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
      }
  };
  </code></pre>
  
  <p>Once adding any of the Protractor functions and running 'ng test', these errors occur:</p>
  
  <pre><code>    ERROR in ./node_modules/saucelabs/index.js
  Module not found: Error: Can't resolve './lib-cov/SauceLabs' in '/Users/moop/Work/frontend/web/node_modules/saucelabs'
   @ ./node_modules/saucelabs/index.js 2:2-32
   @ ./node_modules/protractor/built/driverProviders/sauce.js
   @ ./node_modules/protractor/built/driverProviders/index.js
   @ ./node_modules/protractor/built/runner.js
   @ ./node_modules/protractor/built/index.js
   @ ./e2e/sample.e2e-spec.ts
   @ ./src/test.ts
  
  ERROR in ./node_modules/protractor/built/runner.js
  Module not found: Error: Can't resolve 'child_process' in '/Users/moop/Work/frontend/web/node_modules/protractor/built'
   @ ./node_modules/protractor/built/runner.js 54:32-56
   @ ./node_modules/protractor/built/index.js
   @ ./e2e/sample.e2e-spec.ts
   @ ./src/test.ts
  
  ERROR in ./node_modules/protractor/built/bpRunner.js
  Module not found: Error: Can't resolve 'child_process' in '/Users/moop/Work/frontend/web/node_modules/protractor/built'
   @ ./node_modules/protractor/built/bpRunner.js 3:24-48
   @ ./node_modules/protractor/built/driverProviders/driverProvider.js
   @ ./node_modules/protractor/built/driverProviders/index.js
   @ ./node_modules/protractor/built/runner.js
   @ ./node_modules/protractor/built/index.js
   @ ./e2e/sample.e2e-spec.ts
   @ ./src/test.ts
  
  ERROR in ./node_modules/protractor/built/debugger.js
  Module not found: Error: Can't resolve 'child_process' in '/Users/moop/Work/frontend/web/node_modules/protractor/built'
   @ ./node_modules/protractor/built/debugger.js 67:32-56
   @ ./node_modules/protractor/built/browser.js
   @ ./node_modules/protractor/built/index.js
   @ ./e2e/sample.e2e-spec.ts
   @ ./src/test.ts
  
  ERROR in ./node_modules/selenium-webdriver/firefox/binary.js
  Module not found: Error: Can't resolve 'child_process' in '/Users/moop/Work/frontend/web/node_modules/selenium-webdriver/firefox'
   @ ./node_modules/selenium-webdriver/firefox/binary.js 25:14-38
   @ ./node_modules/selenium-webdriver/firefox/index.js
   @ ./node_modules/protractor/built/index.js
   @ ./e2e/sample.e2e-spec.ts
   @ ./src/test.ts
  
  ERROR in ./node_modules/selenium-webdriver/io/exec.js
  Module not found: Error: Can't resolve 'child_process' in '/Users/moop/Work/frontend/web/node_modules/selenium-webdriver/io'
   @ ./node_modules/selenium-webdriver/io/exec.js 20:21-45
   @ ./node_modules/selenium-webdriver/remote/index.js
   @ ./node_modules/protractor/built/index.js
   @ ./e2e/sample.e2e-spec.ts
   @ ./src/test.t
  </code></pre>
  
  <p>Does anyone have an idea about what is causing this and how I can fix it?</p>