1

I just installed protractor and the default repo along with webdriver. Every time I run protractor I get this error

module.js:340
    throw err;
          ^
Error: Cannot find module '/usr/local/lib/node_modules/protractor/lib/cli.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

Not sure how to fix this... any clues?

climboid
  • 6,932
  • 14
  • 44
  • 71
  • Possible duplicate of [Error: Cannot find module '../lib/cli'](http://stackoverflow.com/questions/29323982/error-cannot-find-module-lib-cli) – guy mograbi Jun 28 '16 at 15:11
  • Try using my protractor code generator. It will create an empty protractor project that you can use. The instructions should be easy to follow. If you have feedback to improve the documentations let me know. https://npmjs.org/package/generator-protractor – Andres D Dec 14 '13 at 03:54

2 Answers2

2

Try to use the following solution :

under Configuration , use this for javascript file = /usr/lib/node_modules/protractor/lib/cli.js

I faced similar issue , it got resolved . I am using WebStorm in linux environment .

Make sure you installed protractor on the global position , by using this command :

  1. sudo npm install -g protractor
  2. sudo webdriver-manager update
  3. webdriver-manager start
Ankit Singhal
  • 36
  • 1
  • 6
0

Got stuck similarly ... this worked for me. Make sure to have "node_modules" & "node_modules/.bin" in the project folder, you can generate them by running "npm install protractor" on the project root folder and then get rid of it "protractor" folder by running "npm uninstall protractor".

Abhijeet
  • 8,561
  • 5
  • 70
  • 76