Angular-seed protractor throws error - angularjs

I try run angular-seed on my computer (Windows 10, last update) https://github.com/angular/angular-seed. Web works fine, but I have problem with protractor. Karma runs, but when I try protractor > npm run protractor I get these error.
E:\angular-seed>npm run protractor
> angular-seed#0.0.0 preprotractor E:\angular-seed
> npm run update-webdriver
> angular-seed#0.0.0 preupdate-webdriver E:\angular-seed
> npm install
npm WARN install Couldn't install optional dependency: Unsupported
> angular-seed#0.0.0 postinstall E:\angular-seed
> bower install
> angular-seed#0.0.0 update-webdriver E:\angular-seed
> webdriver-manager update
selenium standalone is up to date.
chromedriver is up to date.
> angular-seed#0.0.0 protractor E:\angular-seed
> protractor e2e-tests/protractor.conf.js
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
[launcher] Process exited with error code 1
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn java ENOENT
at exports._errnoException (util.js:855:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:455:9)
at process._tickCallback (node.js:369:17)
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "protractor"
npm ERR! node v5.3.0
npm ERR! npm v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! angular-seed#0.0.0 protractor: `protractor e2e-tests/protractor.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-seed#0.0.0 protractor script 'protractor e2e-tests/protractor.conf.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular-seed package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! protractor e2e-tests/protractor.conf.js
npm ERR! You can get their info via:
npm ERR! npm owner ls angular-seed
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! E:\angular-seed\npm-debug.log
I have all up to date. I clone from git today and run npm update. It is my problem or it is package problem?

Home page of Angular seed doesn't mentioned that, but protractor has dependency on JDK. Do you have it installed? You can check this by
java --version

Related

Error with node.js deployment on Linux Azure web app

I habe an azur app service (Linux), connected to a bitbucket git repository running.
When I try to deploy it, I get this error:
> lhfrontend#1.0.0 postinstall /home/site/wwwroot
> npm run webdriver:update
npm WARN invalid config loglevel="notice"
> lhfrontend#1.0.0 webdriver:update /home/site/wwwroot
> node ./node_modules/protractor/bin/webdriver-manager update
module.js:471
throw err;
^
Error: Cannot find module '/home/site/wwwroot/node_modules/protractor/bin/webdriver-manager'
An error has occurred during web site deployment.
at Function.Module._resolveFilename (module.js:469:15)
npm failed
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3
npm ERR! Linux 4.4.0-108-generic
npm ERR! argv "/opt/nodejs/6.11.0/bin/node" "/usr/bin/node_modules/npm/bin/npm-cli.js" "run" "webdriver:update"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! lhfrontend#1.0.0 webdriver:update: `node ./node_modules/protractor/bin/webdriver-manager update`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lhfrontend#1.0.0 webdriver:update script 'node ./node_modules/protractor/bin/webdriver-manager update'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the lhfrontend package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./node_modules/protractor/bin/webdriver-manager update
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs lhfrontend
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls lhfrontend
npm ERR! There is likely additional logging output above.
Does any one have an idea, how to fix this?
Thanks in advance,
Dennis
Check if you have installed protractor module. If not, run this command in your app's root:
npm install protractor
Or add this to the dependencies section of your package.json:
"dependencies": {
"protractor": "^5.2.2"
}

yo angular error after package.json

I am trying to install angular on my windows 10. I followed every step in the yo tutorial, but once I get to package.json everything fails and shows errors. can anyone help me figuring out how to solve this. I have tried for almost a week searching online and nothing has worked. Error shown bellow:
*? Overwrite package.json? overwrite
force package.json
identical .travis.yml
bower ENOGIT git is not installed or not in the PATH
> phantomjs#1.9.17 install C:\Users\carli\node_modules\phantomjs
> node install.js
grunt-cli: The grunt command line interface. (v0.1.13)
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:
http://gruntjs.com/getting-started
> phantomjs#1.9.17 install C:\Users\carli\node_modules\phantomjs
> node install.js
module.js:338
throw err;
^
Error: Cannot find module 'C:\Users\carli\node_modules\phantomjs\install.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Function.Module.runMain (module.js:475:10)
at startup (node.js:117:18)
at node.js:951:3
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\carli\\AppDat
Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.0.0
npm ERR! npm v2.14.3
npm ERR! code ELIFECYCLE
npm ERR! phantomjs#1.9.17 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs#1.9.17 install script 'node install.js'.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\carli\npm-debug.log
module.js:338
throw err;
^
Error: Cannot find module 'C:\Users\carli\node_modules\phantomjs\install.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Function.Module.runMain (module.js:475:10)
at startup (node.js:117:18)
at node.js:951:3
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\carli\\AppDat
Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.0.0
npm ERR! npm v2.14.3
npm ERR! code ELIFECYCLE
npm ERR! phantomjs#1.9.17 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs#1.9.17 install script 'node install.js'.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\carli\npm-debug.log*
I am trying to learn about Angularjs and this is one of the steps that is holding me back

Trying to run protractor in Step 3 in angular js tutorial

I am unable to run e2e test using protractor
When I am trying to run the angular phonecat app code from https://docs.angularjs.org/tutorial
It is showing this error
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver [launcher] Process exited with error code 1
events.js:85
throw er; // Unhandled 'error' event
^ Error: spawn java ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\no un" "protractor"
npm ERR! node v0.12.7
npm ERR!
npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! angular-phonecat#0.0.0 protractor: `protractor test/protractor-conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-phonecat#0.0.0 protractor script 'protractor test/pro
npm ERR! This is most likely a problem with the angular-phonecat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! protractor test/protractor-conf.js
npm ERR! You can get their info via:
npm ERR! npm owner ls angular-phonecat
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\xxxxx\Documents\GitHub\angular-phonecat\npm-debug.log
You have chrome and chrome driver installed?
Try this:
In 'protractor-conf.js' remove 'chromeOnly: true,' and put 'directConnect: true,'.
you can find it in angular_phonecat\test
plus, run node cmd in administrator mode. That was the missing link for me!

Errors running e2e tests in Protractor

I am trying to run the scenarios.js Protractor e2e test in the angularjs tutorial, here https://docs.angularjs.org/tutorial. I am following the instructions on the tutorial step two in the blue box.
If I cd into the angular-phonecat directory like they say, I can run npm install, npm run update-webdriver and npm start without errors. I have Version 2.1.0 of protractor installed but when I try to run it I get these errors:
npm ERR! Darwin 14.3.0
npm ERR! argv "node" "/usr/local/bin/npm" "run" "protractor"
npm ERR! node v0.12.4
npm ERR! npm v2.11.1
npm ERR! code ELIFECYCLE
npm ERR! angular-phonecat#0.0.0 protractor: `protractor test/protractor-conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-phonecat#0.0.0 protractor script 'protractor test/protractor-conf.js'.
npm ERR! This is most likely a problem with the angular-phonecat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! protractor test/protractor-conf.js
npm ERR! You can get their info via:
npm ERR! npm owner ls angular-phonecat
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/cohenwan/Sites/angular-phonecat/npm-debug.log
I am not sure if the documentation for the app tutorial is faulty, but I would really like to learn how to end2end test in Protractor, but this isn't helpful. Any recommendations? Or suggestions of better ways to learn Protractor?
I found out I needed to download chrome driver here: http://chromedriver.storage.googleapis.com/index.html?path=2.15/. I downloaded the mac32.zip. And now it is working.

angular phonecat tutorial protractor testcase failure

I've just installed the angular phonecat tutorial here on an old laptop running Lubuntu 14.04. When I run npm run protractor it fails on the 5th testcase listed in the scenarios.js file. The testcase in question is:
it('should display nexus-s page', function() {
expect(element(by.binding('phone.name')).getText()).toBe('Nexus S');
});
the response at the terminal I get is:
selenium standalone is up to date.
chromedriver is up to date.
> angular-phonecat#0.0.0 protractor /home/david/angular-phonecat
> protractor test/protractor-conf.js
Using ChromeDriver directly...
....F..
Failures:
1) PhoneCat App Phone detail view should display nexus-s page
Message:
Expected '' to be 'Nexus S'.
Stacktrace:
Error: Failed expectation
at [object Object].<anonymous> (/home/david/angular-phonecat/test/e2e/scenarios.js:84:59)
Finished in 19.212 seconds
7 tests, 11 assertions, 1 failure
npm ERR! angular-phonecat#0.0.0 protractor: `protractor test/protractor-conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-phonecat#0.0.0 protractor script.
npm ERR! This is most likely a problem with the angular-phonecat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! protractor test/protractor-conf.js
npm ERR! You can get their info via:
npm ERR! npm owner ls angular-phonecat
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.13.0-39-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "run" "protractor"
npm ERR! cwd /home/david/angular-phonecat
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/david/angular-phonecat/npm-debug.log
npm ERR! not ok code 0
I'm running this on a fairly old laptop so I wonder if its a performance issue.

Resources