'webdriver-manager start' step is getting stuck while executing in cmd - node.js

After installing protractor and trying to execute: webdriver-manager start in the command terminal, the following error is thrown:
[17:39:27] I/start - seleniumProcess.pid: undefined
[17:39:27] W/start - Selenium Standalone server encountered an error: Error: spawn cmd ENOENT.
I pasted the latest chrome driver, gecko driver and selenium standalone in npm\node_modules\protractor\node_modules\webdriver-manager\selenium, So I did not execute webdriver-manger update within the command terminal.
I am not able to resolve this issue, any help would be greatly appreciated!

ENOENT errors indicate that your program wasn't able to find the necessary entity to proceed in execution, usually this is a file, directory, symlink, pipe, etc...
In your particular case it couldn't find: the Selenium Standalone server binary
This is because instead of following protractor documentation and executing webdriver-manager update to get the necessary binaries to start a Selenium server you simply pasted the binaries in a location that you thought protractor would use to find said binaries. This location is incorrect, so you're unable to start the Selenium server properly. You can see where global npm_modules are installed on your system by executing a: npm list -g.
Typically this on Unix based systems this location is: /usr/local/lib/node_modules
And on Windows:
%USERPROFILE%\AppData\Roaming\npm\node_modules
In order to resolve this issue I would recommend you follow the documentation as it's stated or search through protractor's source code to see where the binaries are actually stored.
Maybe you could try the following and see if this helps resolve your issue, directly from their documentation:
Use npm to install Protractor globally with:
npm install -g protractor
This will install two command line tools, protractor and webdriver-manager. Try running protractor --version to make sure it's working.
The webdriver-manager is a helper tool to easily get an instance of a Selenium Server running. Use it to download the necessary binaries with:
webdriver-manager update
Now start up a server with:
webdriver-manager start
This will start up a Selenium Server and will output a bunch of info logs.
Hopefully that helps!

just add to your PATHs C:\Windows\System32

Related

nmp install -g under Windows 10, not recognized as a command

While logged in to Windows 10 as a User, and opened the command prompt as an Adminstrator, cd to my nodeJs project directory and did npm install browser-refresh -g in order to install the browser-refresh package from the npm which went ok but with some "npm WARN deprecated" messages. and the confirmatioin
browser-refresh#1.7.3
then I modified my code according to the package instructions and did browser-refresh index.js which suppose to replaces node index.js but I get the error
'browser-refresh' is not recognized as an internal or external command, operable program or batch file.
So I installed it locally with out the -g tag for no avail. I able to run it using the command C:\Users\adminName\AppData\Roaming\npm\browser-refresh index.js
I added the path above to the list of Paths under "System variables > Path" for no avail. I may un install the local package since that did not work. Someone please suggests a working solution.
Even though I get it running with the long command, the pacakge did not refresh the web page after changed the index.html file and saved it but this may be a different question.
Thank you
The path to the NPM bin folder may not be defined in your PATH environment variable. You can test this by installing another package that should be executable from the command line and checking to see if executing it results in the same error.
If it does, you can "%AppData%\npm" to your PATH. Here are instructions on how to do so.
Hope this helped!

What is the 'npm' command and how can I use it?

What is npm?
Whenever I browse through some project they ask me to run npm command, something like this
npm install -g node-windows
I went through some blog posts to learn about npm and I installed Node.js. However, when I run the above code in Node.js, I get the following errors:
When I browsed further, I came to know that the windows user can run the command from the cmd prompt window, but when I do that I get some output like this:
Which just generate a text file nothing else.
My questions:
How can I get started with the AngularJS2?
How can I run an npm command?
Do I require a command prompt to run the npm command (in Windows), or I can just use Node.js?
When I use the command npm install in my command prompt, I get the following output:
How to get started with the angularJS2
Follow this link and set up the project by following instructions
How to run a npm command
npm stands for Node Package Manager, and therefore you need Node.js installed before you can run npm commands.
Follow this and install the latest version. And restart the command prompt.
Do I require a command prompt to run npm commands (in Windows), or can I just use Node.js?
Yes, you need to run npm commands from the command line (in Windows).
E.g., npm install
You get the warning because there is no package.json file present where you are running the command.
ENOENT stands for Error NO ENTrey
Navigate to the project folder using the following command and then run npm install
cd <projectpath>
The AngularJS 2 website has everything you need to be covered. Their quickstart guide alongside with the quickseed zip file helps a lot.
But, in case you missed some points:
yes, you will need npm/NodeJS. So, download the latest distribution and have a clean installation of it.
you can execute the npm command with its parameters from within the Windows cmd.
the quickseed ZIP file contains all the files you need to see a live and quick example running locally. Unzip it on your workplace and navigate to it using the windows cmd. When inside the root folder of the unzipped package, execute npm install and right after it npm start.
Take the learning path. Step by step, all your questions will be answered.
You need to use an admin prompt for global installation (-g).

BrowserSync : Command not found after installing browser-sync

There was another issue open with the same title which has been closed but my error could not be resolved using the solutions given in that issue.
Mac OSX El Capitan
Node [v5.6.0]
Npm [v3.6.0]
I installed Browser-Sync successfully using :
bash
$ sudo npm install -g browser-sync
but when I check the browser-sync version by typing :
bash
$ browser-sync --version
I get this error :
bash
-bash: browser-sync: command not found
Check where npm installs it's binaries by running npm bin -g, and then add that to your PATH.
export PATH=$PATH:/usr/local/bin
None of this was helpful to me, instead what I did was find the file location of browser sync after i executed the browser-sync download command supplied on their website. npm install -g browser-sync
Turns out my windows 10 put that downloaded file into %appdata% folder which is in Local Disk (C), but it's an invisible folder and not the correct place it should be, it needs to be in the nodejs folder inside Program Files...
So to find this folder do this: in the search bar of windows 10 type in %appdata% and press Enter, it should open up that hidden folder...
Then click on npm > npm_modules > then you should see files saying browser-sync. Highlight and drag all those files into Local Disk (C) > Program Files > nodejs. You will get allow access prompts, just allow all those.
Now browser-sync and nodejs are sitting happily together and NOW, you can go back to your CMD window and type in browser-sync --version and get the correct version.
I am taking the Coursera class titled HTMl, CSS, and Javascript for Web Developers and ran into this very problem and this solution made it possible for me to continue setting up my environment to take the class.
Although above answers are correct, there is an easy way to handle this. Instead of explicitly creating $PATH we can install Browsersync globally.
npm i -D browser-sync
Here -g option specifies npm to install browser-sync package globally and add $PATH automatically. Next check wether it is working or not by running:
browser-sync --version
Note: Even if you already installed Browsersync try running this. The issue will be resolved.

What location does Node.js needs to be installed

I am trying to setup a project to work with Grunt. I need to install Node.js for that to run. I have downloaded and installed Node.js in c:\programfiles.
However when I try running npm install in my project c:\Grunt-proj , I get an error 'npm' is not recognized as an internal or external command.
Can someone help me with where to install Node.js? I am trying to follow this tutorial-
http://24ways.org/2013/grunt-is-not-weird-and-hard/
Many thanks,
The location is fine. I also have installed it in Program Files. But if you need to run the command npm from a command prompt then you need to add it to the path of the system. In my case I have C:\Program Files\nodejs

Protractor is not recognized as an internal or external command, operable program or batch file

I have protractor installed on windows slave machine. I am trying to run my script using node index.js.
If I trigger job from jenkins to run above command it gives error like Protractor is not recognized as an internal or external command, operable program or batch file.. But when I run command directly on slave machine it execute it successfully.
You can use the Jenkins NodeJS plugin(https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin) to install node and additional npm packages like protractor, grunt, etc.
After installing npm packages at global level, you can select the "Provide Node & npm bin/folder to PATH" checkbox to ensure you can run "protractor", "grunt" into shell or batch command.
Hope this helps.
I had same problem
In jenkins, just go to same directory where protractor and webdriver file is present after installing npm install -g protractor
like in build environment > cd go to same directory then
run commands with node appended to them such as
node webdriver-manager start
node protractor "path where config.js" is kept
This solution works for me!! Happy Automating
This Issue occurs because if you have installed the NodeJS after starting the Jenkins server.
The solution is simple:
Restart your Jenkins Server

Resources