How can I revert Protractor back to a selected version? - node.js

Current Node Version: V15.3.0
Current Webdriver-manager Version: 7.0.15
I am at a loss. My end-to-end automated testing was running great, until the company I work for upgraded Google Chrome to 86.0.4240.111, previously we were using Chrome 83. So naturally with the update I ran the following command webdriver-manager update --versions.chrome=86.0.4240.111 however afterwards when I attempted to run my testing, I received the error stating that ChromeDriver only supports Chrome version 87. During this time I believe I had Node version V14.5.x or close to, Webdriver was version 6.14.x.
I talked with IT and we were unable to find an older version of Chrome from a trusted website to revert Google Chrome back, and so I upgraded Node and npm to the current versions stated above. Now after updating Webdriver-manager I get the error that ChromeDriver only supports Chrome version 87. I talked with IT and they will not upgrade to 87 even though it was released this past week.
My question is there any version which I can install Node and NPM in which I can use my testing with the current version of chrome which is 86.0.4240.111?
And what specific commands would I need to install the said version. Would it be npm install npm#[Enter Version Here]?
Thank you for taking the time to read and look at my question. If any more info is needed please let me know and I will gladly give you what I can!

Node version doesn't matter
npm version doesn't matter
You don't need to revert protractor
It's difficult to downgrade your browser, due to security concerns. You can only go up in version, but you can install any version of the chromedriver
what you actually need to do is to match a version of your local chrome to the version of chromedriver (the driver is the layer that controls your browser, so it's important to make them correspond to each other). So
First, find out what your version of chrome is. From your example I understand it is 86.0.4240.111
Then, find out what chromedriver version can be used. Take the major version of the browser (first 3 numbers, 86.0.4240 in your case) and find the corresponding version of the driver by going to this url https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION} (put the major browser version instead of ${CHROME_VERSION}). You'll see the chromedriver you're looking for is 86.0.4240.22
This is where the trickiest part begins. There are 2 installation of protractor usually:
local
global
I won't go over how to find which one you use, you can look it up. But when you find it, make sure you're updating the right one
When you know which protractor you're updating, go to it's folder and from that folder run npm i webdriver-manager#latest and then node ./bin/webdriver-manager update --gecko=false
when you updated the right webdriver, install the right chromedriver like so
node ./bin/webdriver-manager update --gecko=false --versions.chrome $VERSION
Make sure to put 86.0.4240.22 instead of $VERSION

Related

Why is node.js "automatically" updating to latest version on Windows?

I have been using node.js for some years on Windows (10/11) and it has never automatically updated from the version that I originally installed.
Over the last few days, I have noticed that the version I originally installed (18.10.0) is being updated to 19.1.0.
Uninstalling version 19.1.0 and reinstalling 18.10.0 keeps the installed version temporarily, but at some undetermined point in time it automatically updates to later version again.
I am perplexed as to why the installation is automatically being updated. In this case to an odd numbered node.js version which results in the message "Odd numbered Node.js versions will not enter LTS status and should not be used for production." during a build.
Has anybody else experienced node.js automatically updating?
Is it possible that something else may be forcing the update?

How to install a new version of npm?

I know this is a noob question but I just start learning to code. I don't know why I cannot upgrade the current version of npm in my computer (5.5.1) to the newer one (8.1.2).
Can someone please help me with this?
There are couple of solutions I can think of:
Solution #1
Uninstall Node.js from your computer and install again. As the error message says, "use the version of npm that is bundled with Node.js". This is the preferred solution and very straightforward. Unless... you want to keep multiple versions of node in your computer, if that is the case, solution #2 will help.
Solution #2
Install a Node version manager (such as n). The package n allows you to download multiple versions of Node.js in your computer and switch between then when needed.
If the issue persists, you may have conflicting versions or directories in your computer. Please read this post about How to completely remove node.js from Windows. Then try re-installing from the website once you are done removing Node.

Any way to prevent Node.js update automatically on Windows 10?

I installed Node.js on Windows version v14.15.5 for a project without checking anything on the prompts during the installation. Then at some point Node.js automagically updates to latest version v16... Any way to disable this update regardless what is happening in the code of the project or elsewhere in the system. Just wish to always keep same version that was installed or specific version, in this case v14.15.5. Thank you
Except nvm there is another reason for the automatic update.
Disclaimer: In my case it was Chocolatey.
Chocolatey can be installed as last step of node installation.
You should be able to stop this with chocolatey pin command.
Something like this:
choco pin add -n="nodejs"
choco pin add -n="nodejs.install"

How to install latest ionic2 components

I am currently using ionic2 to try creating a cross plattform app. I know that ionic2 still is under heavy construction and that things (may) change at any time.
Still i wonder how I could install the latest components/api stuff from the nightly builds (or whereever they reside).
I am especially referring to the infiniteScroll Component that is mentioned in the API-Documents of ionic2.
Since i don't understand the layout of the components inside my project fully, i checked where i could see some of them in the directory structure. If i get this right, they all reside in <projectHome>/node_modules/ionic-framework/components?
At least lots of the components mentioned in the documentation above are listed there.
But as i can't find the infiniteScroll Component there, i would like to get some hints on how to install this (and the other missing ones) either by directly giving the respective commands or by pointing to appropriate documentation (i simply did not find anything although searched quite a while for it).
ionic info shows:
Your system information:
Cordova CLI: 6.0.0
Ionic Version: 2.0.0-beta.1
Ionic CLI Version: 2.0.0-beta.17
Ionic App Lib Version: 2.0.0-beta.8
ios-deploy version: 1.7.0
ios-sim version: 4.1.1
OS: Mac OS X El Capitan
Node Version: v5.6.0
Xcode version: Xcode 7.0 Build version 7A220
Sir,
Ionic made some changes in their latest commit. You could see the changes here in the changelog. (Mar 1)
The components are not present in 'ionic-framework/ionic' anymore and they are now present in 'ionic-angular'.
Infinite scroll was added in the release 2.0.0-beta.2, whereas you use the previous release 2.0.0-beta.1 So you might not be able to add it. You could change your package.json to reflect the latest version like shown below.
"ionic-angular": "2.0.0-beta.2",
I would recommend you to read the changelog as it would give a better idea. Hope this was helpful. Thanks.

Where and how can I get a certain version of NodeJs?

I'll be attending a MS course tomorrow and I'm supposed to install NodeJs version 0.12.7. However, when I follow the link provided, I only get a directory listing of a bunch of files. And I'm certainly not sure which one(s) I need (I'm on Win 8).
I also tried with their front page but the versions advertised there are v.4.2.2 and v.5.0.0, which surprised me (cf. v.0.12.7). When I went to the downloads' section, I got totally confused by the overwhelming number of options, platforms, versions etc.
I trust my godlike ability to pick just the wrong option as well as my superpower of confusing everything to the edge of ridiculousness, so instead of cursing my rectum off, I prefer to ask straight how to obtain the requested version (v.0.12.7 for Win 8).
I would suggest nvm, it's great for node version management and installing any particular version of node you would like. https://github.com/creationix/nvm
If you're running 32-bit Windows, then you want the node-v0.12.7-x86.msi file in the directory in your link.
If you're running 64-bit Windows, then you want the node-v0.12.7-x64.msi file in the x64 subdirectory.
As #Ryan McDermott suggested, nvm is good. Another option, which I like, is nodenv: https://github.com/OiNutter/nodenv.
First, install nodenv. Then, install the plugin node-build (https://github.com/OiNutter/node-build). Then you can do the following:
nodenv install --list # list available node versions
nodenv install 0.12.7 # install the specified version
nodenv global 0.12.7 # use the specified version of node

Resources