0

I am using Windows Server 2008 R2 EE OS. In which I have npm package manager. I am trying to run the below command to install Selenium Webdriver package.

Command:

npm install selenium-webdriver

I am receiving below error while doing it.

Error:

node.js npm should be run outside of the node repl in your normal shell

Error received while trying to install.

Ravi Kanasagra
  • 591
  • 1
  • 8
  • 22
  • bro, see my answer below! – pmverma Nov 27 '14 at 05:26
  • 1
    @Ravi- You don't need to open Node prompt. Just type what pmverma suggested in a normal command prompt – Sakshi Singla Nov 27 '14 at 05:30
  • After creating folder, installation works fine in my local machine but it is not working in my office machine. Please find the link with details http://stackoverflow.com/questions/27165638/network-error-while-installing-selenium-webdriver-package-using-npm – Ravi Kanasagra Nov 27 '14 at 07:54
  • I have solved error in installing selenium-webdriver package. Now I tried to run the javascript code using node and received error as per the link http://stackoverflow.com/questions/27121171/example-to-use-webdriverjs-selenium?noredirect=1#comment42820491_27121171 – Ravi Kanasagra Nov 28 '14 at 03:15

2 Answers2

2

You are running the npm command inside the node shell. Open another shell and just type "npm install bla-bla", npm should be on the PATH. Or cd to its directory and type command.

See my command images

Doing it wrong Doing it wrong

Doing it right Doing it right

In the case of windows, sometimes it is bad to consider that the npm will create folder itself for what it required.

The best is to manually create npm folder like "C:\Users\username\AppData\Roaming\npm".

Hope this help.

pmverma
  • 1,653
  • 13
  • 27
  • I tried but got error as shown in the screenshot in my questions. It may possible I have misunderstood steps you suggested. Kindly elaborate. – Ravi Kanasagra Nov 27 '14 at 05:19
  • What I did was opened npm node & command prompt and run command "npm install selenium-webdriver" in both and received some error. Kindly help. – Ravi Kanasagra Nov 27 '14 at 05:21
  • I have solved error in installing selenium-webdriver package. Now I tried to run the javascript code using node and received error as per the link http://stackoverflow.com/questions/27121171/example-to-use-webdriverjs-selenium?noredirect=1#comment42820491_27121171 – Ravi Kanasagra Nov 28 '14 at 03:15
0

By creating a folder C:/Users//AppData/Roaming/npm solved my problem.

Ravi Chandra
  • 677
  • 12
  • 24