-2

I have experience of using selenium using core java but I also want to learn node.js with selenium webdriver.

Can anyone please give me steps to how to do it.

I have already install webstorm in linux. I have somehow install node.js also. when I am hitting node.js version on terminal it give me v0.10.25.

Now the problem begins when I start new project intially webstorm give me error something like this :-

Error creating Node.js Express App. Failed command:
/usr/bin/npm install
Exit code: 34
Standard error:
npm ERR! install Couldn't read dependencies
npm ERR! Error: ENOENT, open '/home/shubham/package.json'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.13.0-62-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/shubham/untitled
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /home/shubham/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/shubham/untitled/npm-debug.log
npm ERR! not ok code 0

I dont know how to configure selenium webdriver here. In java I am just set the jars in my build path. Anyone one tell me what I am doing wrong. Please also provide some tutorials or blogs which can help me to configure this and also help me to learn node.js for webdriver. I love to use eclipse as it suggested error but here it's like I am shooting in dark :)

Shubham Jain
  • 16,610
  • 15
  • 78
  • 125
  • 1
    You don't have `package.json` file on the path `/home/shubham/`, which contains the dependencies of your app. Also check http://stackoverflow.com/questions/25093276/node-js-windows-error-enoent-stat-c-users-rt-appdata-roaming-npm. Might help you – Tushar Sep 04 '15 at 07:45
  • How to get that and how to configure it .. Tushar actually I am new in node.js so dont know about same – Shubham Jain Sep 04 '15 at 07:48
  • Use [npm init](https://docs.npmjs.com/cli/init) – Tushar Sep 04 '15 at 07:49
  • try to run command from your project directory not from /usr/bin – Anshuman Jaiswal Sep 04 '15 at 07:51

1 Answers1

1

You can use this node.js PPA:

ppa:chris-lea/node.js Launchpad logo (Click here for instructions on using PPAs.)

If you're on Ubuntu Server, first do this:

sudo apt-get install python-software-properties Then, do this:

sudo add-apt-repository ppa:chris-lea/node.js

sudo apt-get update

sudo apt-get install nodejs

Then, you have the latest version of node.js installed.