Does Protractor 4 has any dependency? - protractor

I have been using protractor 3.3.0 and finally decided to move up to V4. I am behind a firewall, so using proxy setup. That setup works fine for v3.3.0, but I am not able to download any of V4. It always results in ECONNREFUSED with error
error on last attempt: Error: tunneling socket cound not be established, cause connect ECONNREFUSED <ip>:<port>"
is there any difference on how to download Protractor V4 and above? I have tried
npm install protractor (my package.json had "protractor": "^4.0.0")
npm install protractor (my package.json had "protractor": "4.0.4")
npm install protractor#4.0.0
npm install protractor#4.0.4
When I couldn't install it, I moved back to v3.3.0.. my package.json has "protractor": "^3.2.2")

The error you are seeing is a common one when connecting through proxies. Please see here for the discussion
And yes there are new dependencies/new versions of old dependencies in Protractor#4.0.4 which will trigger new downloads.
PLs see below for specific details
`
npm view protractor#4.0.4 dependencies
{ 'adm-zip': '0.4.7',
chalk: '^1.1.3',
glob: '^7.0.3',
jasmine: '2.4.1',
jasminewd2: '0.0.9',
optimist: '~0.6.0',
q: '1.4.1',
saucelabs: '~1.3.0',
'selenium-webdriver': '2.53.3',
'source-map-support': '~0.4.0',
'webdriver-manager': '^10.2.2' }
npm view protractor#3.3.0 dependencies
{ 'adm-zip': '0.4.7',
chalk: '^1.1.3',
glob: '~6.0',
jasmine: '2.4.1',
jasminewd2: '0.0.9',
optimist: '~0.6.0',
q: '1.4.1',
request: '~2.67.0',
saucelabs: '~1.0.1',
'selenium-webdriver': '2.52.0',
'source-map-support': '~0.4.0' }

Related

Protractor Process exited with error code 100

I'm trying to setup protractor on different computer. It is using the same files with my other computer (cannot be used because hdisc corrupted).
It run fine on my other computer but I am getting error "Process exited with error code 100" when I tried to run protractor on this one.
I've tried to delete the node modules, clean cache and perform npm install again to install the dependencies. It helps my earlier issue (cannot run webdriver) but is now causing me this one.
[14:44:09] I/launcher - Running 1 instances of WebDriver
[14:44:09] I/local - Starting selenium standalone server...
[14:44:11] E/launcher - Error: Error: Server terminated early with status 1
at earlyTermination.catch.e (C:\Users\PMO\Documents\DG\Jasmine\node_modules\selenium-webdriver\remote\index.js:252:52)
at process._tickCallback (internal/process/next_tick.js:68:7)
[14:44:11] E/launcher - Process exited with error code 100
npm ERR! code ELIFECYCLE
npm ERR! errno 100
npm ERR! ProtractorTutorial# protractor: `protractor conf.js`
npm ERR! Exit status 100
npm ERR!
npm ERR! Failed at the protractor# protractor script.
My current chrome version is: 74.0.3729.131
Webdriver version: chromedriver_74.0.3729.6.exe
OS: Windows 10.
Please advise me on how to fix this issue. Or is there any specific version of chrome and webdriver that can work?
use directConnect=true in your config. if you are already using that, The problem is with the webdriver.
Try running below commands from your project location
webdriver-manager clean
node node_modules/protractor/bin/webdriver-manager update --standalone --versions.standalone=3.8.0
I encountered a similar issue yesterday and inspired by Madhan's solution I worked it out.
I'm learning angularJS thru the official tutorial. I found protractor is actually a standalone tool (I'm a newbie in front-end development), which means it can be run separately.
So following the official setup guide, I run
protractor e2e-tests/protractor.conf.js
and found below feedback:
E/launcher - SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 77
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'xxx', ip: 'xxx', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '11.0.2'
Driver info: driver.version: unknown
remote stacktrace: 0 chromedriver_77.0.3865.40 0x00000001078b7f09 chromedriver_77.0.3865.40 + 3694345
And my chrome version was 76 in the moment.
So after I upgraded chrome to 77, it worked.
Tips:
if use directConnect=true in your config still doesn't work, try to run in standalone mode, which can provide you more useful feedback.
For me, the issue was a space after Scenario in the feature file
Wrong Scenario :
Corrected to Scenario: and the feature started executing
Cant see this answer above, so this might help someone
Your problem might be that you need to run your tests without sudo!
Sometimes if you get an EACCESS error, you can then change directory permissions so that you can run it without sudo.
My issue here was an outdated version of webdriver-manager. This fix only partially fixes the issue because it does not update the npm package. To completely fix this you need to ensure your package.json is configured with the correct webdriver-manager version (npm install webdriver-manager#latest --save-dev). Then you'll need to run:
npm install
node ./node_modules/protractor/bin/webdriver-manager clean
node ./node_modules/protractor/bin/webdriver-manager update
You may also need to run a npm dedupe to ensure all items are using the new package
In my case I had to run update + start
node node_modules/protractor/bin/webdriver-manager update --standalone --versions.standalone=3.8.0
node node_modules/protractor/bin/webdriver-manager start --standalone --versions.standalone=3.8.0
thank you 🤘🏻
For me it was a missing tsconfig.json file in my e2e folder. If you don't have one in your e2e folder, simply create one and put this code into it. Then run ng e2e again.
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
I'm using:
Angular CLI: 9.0.7
Node: 14.16.0
Chrome: 89.0.4389.82
chromedriver_89.0.4389.23

spawn EACCES error when serving ionic app

I am using Ionic CLI version 4.2.1 and Ionic Framework version 3.9.2. When I try and use ionic server in my app I get this error:
Error: spawn EACCES
at _errnoException (util.js:992:11)
at ChildProcess.spawn (internal/child_process.js:323:11)
at Object.exports.spawn (child_process.js:502:9)
at spawn
(/usr/local/lib/node_modules/ionic/node_modules/cross-
spawn/index.js:17:18)
at spawn
(/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-
framework/utils/shell.js:131:12)
at ShellCommand.spawn
(/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-
framework/utils/shell.js:120:16)
at Shell.
(/usr/local/lib/node_modules/ionic/lib/shell.js:161:27)
at Generator.next ()
at fulfilled
(/usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:104:62)
at
I got the codebase from another person using the same versions as me, but I have not been able to run it once on my machine.
This is either a permission issue or a a node_modules issue. It's because you transfered the full project folder from another computer.
To resolve the issue, run :
npm rebuild
To clear npm cache and rebuild your modules
And :
chmod 755 -R /yourpath/to/node_modules
The error may be caused by an installation of a module which was made insudo mode

Error with Spawned command: npminstall

I am trying to run a sample application from
https://ionicframework.com/getting-started/.
But I am getting the error - there was an error with the spawned process: npminstall every time I try to run the application. Any help is highly appreciated.
For me it was only to upgrade to new version of npm
npm install -g npm
Spawned command error comes when you try to start a new ionic or cordova app, that gets downloaded from git. This error occurs because your network proxy blocks download a new blank app from git.
To avoid such kind of error try removing the proxies.
1. If you are in a company using their proxy its not possible to do that, so use your own data to do that.
Try downloading a blank app from git using your own data, don't use company network which has proxy enabled.
It will download but while installing the app you will get error like:
Error with start undefined.
Error with spawned command npminstall.
Don't worry a folder will be downloded,
Go to cmd and go inside that app directory and run ionic serve
It will give error like ionic.config.json file didn't find.
create a file with the name ionic.config.json inside the app file.
inside that file paste the following:
{ "name": "your app name", "app_id": "", "v2": true, "typescript": true }
now try running the command ionic serve
your app will run.
I had the similar problem but it worked for me.
install npm globally
npm install -g npm
create a app without installing its packages
ionic start app --v2 --skip-npm
seems ok till now?then
cd app
install packages
npm install --save
done!try to start your ionic app
ionic serve

Ionic push plugin error in installation

When i tried to add ionic push plugin using
ionic plugin add https://github.com/phonegap-build/PushPlugin.git
i got following error in command promp
Updated the hooks directory to have execute permissions Fetching plugin "https://github.com/phonegap-build/PushPlugin.git" via git clone Repository "https://github.com/phonegap-build/PushPlugin.git" checked out to git ref "master". shell.js: internal error Error: EXDEV, cross-device link not permitted 'C:\Users\A-25\AppData\Local\Temp\git\1438839071751\Example'
at Error (native)
at Object.fs.renameSync (fs.js:636:18)
at C:\Users\A-25\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\shelljs\src\mv.js:77:8 at Array.forEach (native)
at Object._mv (C:\Users\A-25\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\shelljs\src\mv.js:53:11)at Object.mv (C:\Users\A-25\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\shelljs\src\common.js:186:23)
at C:\Users\A-25\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\util\plugins.js:53:19
at _fulfilled (C:\Users\A-25\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\A-25\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\A-25\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749:13)
can anybody tell me what's the problem?
i just downgrade my cordova version to 5.0.0 and it works
Without downgrading your cordova version you could try this
ionic plugin add cordova-plugin-push-notification
I had a similar question:
From an official blog post, Cordova is moving their plugins to npm.
I had the same problem with the ionic plugin add ... command that Mudasser mentioned. So, I installed it easily now with npm:
npm install phonegap-plugin-push

cordova add plugin - unable to access

I am trying to add a plugin to Cordova via
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
git itself seems to run fine. Running the following works:
git clone "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git" "D:\Temp\plugman-tmp1390234462383"
This is what is used in plugins.js line 43 (var cmd = util.format(...)).
The error I receive using the cordova plugin add ... is:
Calling plugman.fetch on plugin "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git"
Fetching plugin from "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git"...
Fetching plugin via git-clone command: git clone "https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git" "D:\Temp\plugman-tmp1390235833828"
C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:126
throw e;
^
Error: Fetching plugin failed: Error: Command failed: Cloning into 'D:\Temp\plugman-tmp1390234462383'...
fatal: unable to access 'https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git/': Failed connect to git-wip-us.apache.org:443; No error
at C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\src\plugin.js:90:41
at _rejected (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:808:24)
at C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:834:30
at Promise.when (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1079:31)
at Promise.promise.promiseDispatch (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:752:41)
at C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:574:44
at flush (C:\Users\myUser\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:415:13)
Any idea?
Some more information:
I am going through a proxy, but I set this for git and for npm. I installed Cordova via "npm install cordova" and the project via "cordova create TestApp", I added platforms via "cordova platform add android" and I can run the app on the emulator.
I even tried "phonegap local plugin add https..." with the same result.
All that is missing for me is to add plugins.
Sometimes a Cordova update will cause problems with npm and will corrupt the "cordova cache" that NPM uses to quickly download different Cordova versions. I know there were problems with the server pushing the latest Cordova plugins to NPM, so maybe this is why you're having trouble.
I'd suggest deleting /AppData/Roaming/npm/node_modules/cordova direct in its entirety, than installing a fresh new copy with npm install -g cordova. This shouldn't remove any of your Cordova projects, it will just download a fresh set of the tools. When you run cordova commands, it might take longer the first time since the tools will have to go to the git repo's and fetch the content fresh.
Tried clearing the cordova cache by deleting the folder as suggested by #mbillau but that didn't help. I search for the plugin where I was getting the error and tried installing through command line but got the same error message. Finally the solution that worked for me:
open important files in your IDE
open Cordova plugins
replace all "https://git-wip-us.apache.org/repos/asf/" with "https://git.apache.org/"
and it worked perfectly.
Replace "git-wip-us.apache.org/repos/asf7" with "github.com/apache/"
Like #Max said.
Checking the apache site (either https://git-wip-us.apache.org/repos/asf/, https://gitbox.org/repos/asf/, or https://git.apache.org/) I only see commit logs instead of the sources.
The sources can be found on GitHub. This worked for me:
cordova plugin add https://github.com/apache/cordova-plugin-device.git